]> git.ipfire.org Git - thirdparty/git.git/blobdiff - string-list.c
string-list: use ALLOC_GROW macro when reallocing string_list
[thirdparty/git.git] / string-list.c
index 8c83cac189e94c327327e47cfaadfd621d59b6b9..1e27d9cec3208ff98e3b719077d496419e4136ec 100644 (file)
@@ -41,10 +41,7 @@ static int add_entry(int insert_at, struct string_list *list, const char *string
        if (exact_match)
                return -1 - index;
 
-       if (list->nr + 1 >= list->alloc) {
-               list->alloc += 32;
-               REALLOC_ARRAY(list->items, list->alloc);
-       }
+       ALLOC_GROW(list->items, list->nr+1, list->alloc);
        if (index < list->nr)
                memmove(list->items + index + 1, list->items + index,
                                (list->nr - index)