Skip to content

Commit 5b7eec4

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 564d025 commit 5b7eec4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/fast-import.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,8 +2809,7 @@ static void parse_new_tag(const char *arg)
28092809
enum object_type type;
28102810
const char *v;
28112811

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));
28142813
t->name = mem_pool_strdup(&fi_mem_pool, arg);
28152814
if (last_tag)
28162815
last_tag->next_tag = t;

0 commit comments

Comments
 (0)