mirror of
https://github.com/git/git.git
synced 2026-01-11 21:33:13 +09:00
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:
parent
564d0252ca
commit
5b7eec4bc5
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user