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
@ -211,7 +211,7 @@ static int deflate_to_pack(struct bulk_checkin_state *state,
|
||||
|
||||
/* Note: idx is non-NULL when we are writing */
|
||||
if ((flags & HASH_WRITE_OBJECT) != 0)
|
||||
idx = xcalloc(1, sizeof(*idx));
|
||||
CALLOC_ARRAY(idx, 1);
|
||||
|
||||
already_hashed_to = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user