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>

René Scharfe committed Dec 26, 2023 at 09:17 UTC 5b7eec4bc517311f9ceb2dc7abadcc47ddc6b015
1 file changed +1 -2
builtin/fast-import.c
+1 -2
@@ -2809,8 +2809,7 @@ static void parse_new_tag(const char *arg)
2809 enum object_type type;
2810 const char *v;
2811
2812 - t = mem_pool_alloc(&fi_mem_pool, sizeof(struct tag));
2813 - memset(t, 0, sizeof(struct tag));
2812 + t = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct tag));
2813 t->name = mem_pool_strdup(&fi_mem_pool, arg);
2814 if (last_tag)
2815 last_tag->next_tag = t;