Skip to content

Commit

Permalink
Merge branch 'rs/fast-import-simplify-mempool-allocation' into next
Browse files Browse the repository at this point in the history
Code simplification.

* rs/fast-import-simplify-mempool-allocation:
  fast-import: use mem_pool_calloc()
  • Loading branch information
gitster committed Dec 28, 2023
2 parents 3ddf2eb + 5b7eec4 commit 16e6dd2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin/fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 16e6dd2

Please sign in to comment.