Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
patch-ids.c: use ALLOC_GROW() in add_commit()
author
Dmitry S. Dolzhenko
<dmitrys.dolzhenko@yandex.ru>
Mon, 3 Mar 2014 22:31:55 +0000
(
02:31
+0400)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 3 Mar 2014 22:49:12 +0000
(14:49 -0800)
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch-ids.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
337ce24
)
diff --git
a/patch-ids.c
b/patch-ids.c
index bc8a28fdd71ae1476002d26adec64f54841f5cba..bf81b923610fe2473655560cd111adb3061673d9 100644
(file)
--- 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);
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));
if (pos < ids->nr)
memmove(ids->table + pos + 1, ids->table + pos,
sizeof(ent) * (ids->nr - pos));