fast-import: use mem_pool_calloc()

Use mem_pool_calloc() to get a zeroed buffer instead of zeroing it
ourselves.  This makes the code clearer and less repetitive.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2023-12-26 09:17:45 +01:00 committed by Junio C Hamano
parent 564d0252ca
commit 5b7eec4bc5

View File

@ -2809,8 +2809,7 @@ static void parse_new_tag(const char *arg)
enum object_type type;
const char *v;
t = mem_pool_alloc(&fi_mem_pool, sizeof(struct tag));
memset(t, 0, sizeof(struct tag));
t = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct tag));
t->name = mem_pool_strdup(&fi_mem_pool, arg);
if (last_tag)
last_tag->next_tag = t;