aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBrian Ashworth <RedSoxFan@users.noreply.github.com>2018-12-08 22:40:13 -0500
committerGitHub <noreply@github.com>2018-12-08 22:40:13 -0500
commite7efa0e27b7bf44217d7f147281d463708d2dfc9 (patch)
tree8701e7f607f15f7f3e77bdb5732ccb9a9d67fed4 /common
parent0c3f0dfd16b73f659c4eddd42ae9467bfc25a19c (diff)
parentbd6a63966762f7fdcf5f9cd86bc50f7f0a9515e2 (diff)
Merge pull request #3264 from ianyfan/resize-list
list: double list capacity when resizing instead of incrementing
Diffstat (limited to 'common')
-rw-r--r--common/list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/list.c b/common/list.c
index ee268c9a..66cf133b 100644
--- a/common/list.c
+++ b/common/list.c
@@ -17,7 +17,7 @@ list_t *create_list(void) {
static void list_resize(list_t *list) {
if (list->length == list->capacity) {
- list->capacity += 10;
+ list->capacity *= 2;
list->items = realloc(list->items, sizeof(void*) * list->capacity);
}
}