diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-12-08 22:40:13 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-12-08 22:40:13 -0500 |
| commit | 736a69a558a565b5c1521e9680c1ebbe22630a5c (patch) | |
| tree | 8701e7f607f15f7f3e77bdb5732ccb9a9d67fed4 /common | |
| parent | a355cdeb038bbf93d9f2572f62c9ab3cb07e150e (diff) | |
| parent | 5debd8a4d6015fb9bfd4099d38d2e6037520921c (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.c | 2 |
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); } } |
