Skip to content

Commit cb6c48c

Browse files
ttaylorrgitster
authored andcommitted
midx.c: replace xcalloc() with CALLOC_ARRAY()
Replace a direct invocation of Git's `xcalloc()` wrapper with the `CALLOC_ARRAY()` macro instead. The latter is preferred since it is more conventional in Git's codebase, but also because it automatically picks the correct value for the record size. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d9f7721 commit cb6c48c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

midx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,9 +1912,11 @@ static int fill_included_packs_batch(struct repository *r,
19121912
{
19131913
uint32_t i, packs_to_repack;
19141914
size_t total_size;
1915-
struct repack_info *pack_info = xcalloc(m->num_packs, sizeof(struct repack_info));
1915+
struct repack_info *pack_info;
19161916
int pack_kept_objects = 0;
19171917

1918+
CALLOC_ARRAY(pack_info, m->num_packs);
1919+
19181920
repo_config_get_bool(r, "repack.packkeptobjects", &pack_kept_objects);
19191921

19201922
for (i = 0; i < m->num_packs; i++) {

0 commit comments

Comments
 (0)