summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>2014-03-04 02:31:55 +0400
committerJunio C Hamano <gitster@pobox.com>2014-03-03 14:49:12 -0800
commit104fb26a1e4570d56c7c0a514397ed18e9610b3d (patch)
tree2184bdb1a189208430654ecf5261699367230952
parent337ce247e35b88e8413ab80b43d9ce47729c8136 (diff)
downloadgit-104fb26a1e4570d56c7c0a514397ed18e9610b3d.tar.gz
patch-ids.c: use ALLOC_GROW() in add_commit()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--patch-ids.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/patch-ids.c b/patch-ids.c
index bc8a28fdd7..bf81b92361 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));