mirror of
https://github.com/git/git.git
synced 2026-01-10 18:20:27 +00:00
git: use calloc instead of malloc + memset where possible
Avoid calling malloc + memset by calling calloc. Signed-off-by: Seija Kijin <doremylover123@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d882f382b3
commit
7525cd8c35
4
remote.c
4
remote.c
@@ -2854,9 +2854,9 @@ void apply_push_cas(struct push_cas_option *cas,
|
||||
|
||||
struct remote_state *remote_state_new(void)
|
||||
{
|
||||
struct remote_state *r = xmalloc(sizeof(*r));
|
||||
struct remote_state *r;
|
||||
|
||||
memset(r, 0, sizeof(*r));
|
||||
CALLOC_ARRAY(r, 1);
|
||||
|
||||
hashmap_init(&r->remotes_hash, remotes_hash_cmp, NULL, 0);
|
||||
hashmap_init(&r->branches_hash, branches_hash_cmp, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user