From: Dmitry S. Dolzhenko Date: Mon, 03 Mar 2014 22:31:55 GMT Subject: [PATCH v4 07/14] patch-ids.c: use ALLOC_GROW() in add_commit() Message-ID: <1393885922-21616-8-git-send-email-dmitrys.dolzhenko@yandex.ru> In-Reply-To: <1393885922-21616-1-git-send-email-dmitrys.dolzhenko@yandex.ru> Signed-off-by: Dmitry S. Dolzhenko --- patch-ids.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/patch-ids.c b/patch-ids.c index bc8a28f..bf81b92 100644 --- a/patch-ids.c +++ b/patch-ids.c @@ -83,10 +83,7 @@ static struct patch_id *add_commit(struct commit *commit, ent = &bucket->bucket[bucket->nr++]; hashcpy(ent->patch_id, sha1); - if (ids->alloc <= ids->nr) { - ids->alloc = alloc_nr(ids->nr); - ids->table = xrealloc(ids->table, sizeof(ent) * ids->alloc); - } + ALLOC_GROW(ids->table, ids->nr + 1, ids->alloc); if (pos < ids->nr) memmove(ids->table + pos + 1, ids->table + pos, sizeof(ent) * (ids->nr - pos)); -- 1.8.3.2