Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 104fb26

Browse files
Dmitry S. Dolzhenkogitster
authored andcommitted
patch-ids.c: use ALLOC_GROW() in add_commit()
Signed-off-by: Dmitry S. Dolzhenko <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 337ce24 commit 104fb26

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

patch-ids.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ static struct patch_id *add_commit(struct commit *commit,
8383
ent = &bucket->bucket[bucket->nr++];
8484
hashcpy(ent->patch_id, sha1);
8585

86-
if (ids->alloc <= ids->nr) {
87-
ids->alloc = alloc_nr(ids->nr);
88-
ids->table = xrealloc(ids->table, sizeof(ent) * ids->alloc);
89-
}
86+
ALLOC_GROW(ids->table, ids->nr + 1, ids->alloc);
9087
if (pos < ids->nr)
9188
memmove(ids->table + pos + 1, ids->table + pos,
9289
sizeof(ent) * (ids->nr - pos));

0 commit comments

Comments
 (0)