diff options
author | Elijah Newren <newren@gmail.com> | 2020-11-11 23:02:20 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-11 23:55:27 +0300 |
commit | b19315d8ab46ae50410dba9228a4c08ae5c73e38 (patch) | |
tree | f473f15041b2f515f50aacdda428825e884eb18d /bloom.c | |
parent | 23a276a9c4c8945aadbc323e12c970816eb43c27 (diff) |
Use new HASHMAP_INIT macro to simplify hashmap initialization
Now that hashamp has lazy initialization and a HASHMAP_INIT macro,
hashmaps allocated on the stack can be initialized without a call to
hashmap_init() and in some cases makes the code a bit shorter. Convert
some callsites over to take advantage of this.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bloom.c')
-rw-r--r-- | bloom.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -229,10 +229,9 @@ struct bloom_filter *get_or_compute_bloom_filter(struct repository *r, diffcore_std(&diffopt); if (diff_queued_diff.nr <= settings->max_changed_paths) { - struct hashmap pathmap; + struct hashmap pathmap = HASHMAP_INIT(pathmap_cmp, NULL); struct pathmap_hash_entry *e; struct hashmap_iter iter; - hashmap_init(&pathmap, pathmap_cmp, NULL, 0); for (i = 0; i < diff_queued_diff.nr; i++) { const char *path = diff_queued_diff.queue[i]->two->path; |