diff options
author | René Scharfe <l.s.r@web.de> | 2023-12-26 11:17:45 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-26 22:06:23 +0300 |
commit | 5b7eec4bc517311f9ceb2dc7abadcc47ddc6b015 (patch) | |
tree | 186a83c4ab0bd27e13b9c723ff8e69bc7cc99c1d /builtin | |
parent | 564d0252ca632e0264ed670534a51d18a689ef5d (diff) |
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/fast-import.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 444f41cf8c..92eda20683 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -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; |