use REALLOC_ARRAY for changing the allocation size of arrays

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2014-09-16 20:56:57 +02:00
committed by Junio C Hamano
parent 3ac22f82ed
commit 2756ca4347
26 changed files with 40 additions and 70 deletions

View File

@ -89,8 +89,7 @@ static void index_commit_for_bitmap(struct commit *commit)
{
if (indexed_commits_nr >= indexed_commits_alloc) {
indexed_commits_alloc = (indexed_commits_alloc + 32) * 2;
indexed_commits = xrealloc(indexed_commits,
indexed_commits_alloc * sizeof(struct commit *));
REALLOC_ARRAY(indexed_commits, indexed_commits_alloc);
}
indexed_commits[indexed_commits_nr++] = commit;