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:

committed by
Junio C Hamano

parent
3ac22f82ed
commit
2756ca4347
@ -400,10 +400,8 @@ static int ext_index_add_object(struct object *object, const char *name)
|
||||
if (hash_ret > 0) {
|
||||
if (eindex->count >= eindex->alloc) {
|
||||
eindex->alloc = (eindex->alloc + 16) * 3 / 2;
|
||||
eindex->objects = xrealloc(eindex->objects,
|
||||
eindex->alloc * sizeof(struct object *));
|
||||
eindex->hashes = xrealloc(eindex->hashes,
|
||||
eindex->alloc * sizeof(uint32_t));
|
||||
REALLOC_ARRAY(eindex->objects, eindex->alloc);
|
||||
REALLOC_ARRAY(eindex->hashes, eindex->alloc);
|
||||
}
|
||||
|
||||
bitmap_pos = eindex->count;
|
||||
|
Reference in New Issue
Block a user