summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-11-11 20:02:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-11-11 20:55:27 (GMT)
commitb19315d8ab46ae50410dba9228a4c08ae5c73e38 (patch)
treef473f15041b2f515f50aacdda428825e884eb18d /t
parent23a276a9c4c8945aadbc323e12c970816eb43c27 (diff)
downloadgit-b19315d8ab46ae50410dba9228a4c08ae5c73e38.zip
git-b19315d8ab46ae50410dba9228a4c08ae5c73e38.tar.gz
git-b19315d8ab46ae50410dba9228a4c08ae5c73e38.tar.bz2
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 't')
-rw-r--r--t/helper/test-hashmap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 2475663..36ff07b 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -151,12 +151,11 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
int cmd__hashmap(int argc, const char **argv)
{
struct strbuf line = STRBUF_INIT;
- struct hashmap map;
int icase;
+ struct hashmap map = HASHMAP_INIT(test_entry_cmp, &icase);
/* init hash map */
icase = argc > 1 && !strcmp("ignorecase", argv[1]);
- hashmap_init(&map, test_entry_cmp, &icase, 0);
/* process commands from stdin */
while (strbuf_getline(&line, stdin) != EOF) {