use CALLOC_ARRAY
Add and apply a semantic patch for converting code that open-codes CALLOC_ARRAY to use it instead. It shortens the code and infers the element size automatically. Signed-off-by: René 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
f1121499e6
commit
ca56dadb4b
@ -49,7 +49,7 @@ static void rehash_objects(struct packing_data *pdata)
|
||||
pdata->index_size = 1024;
|
||||
|
||||
free(pdata->index);
|
||||
pdata->index = xcalloc(pdata->index_size, sizeof(*pdata->index));
|
||||
CALLOC_ARRAY(pdata->index, pdata->index_size);
|
||||
|
||||
entry = pdata->objects;
|
||||
|
||||
|
Reference in New Issue
Block a user