summaryrefslogtreecommitdiff
path: root/t/helper/test-hashmap.c
diff options
context:
space:
mode:
Diffstat (limited to 't/helper/test-hashmap.c')
-rw-r--r--t/helper/test-hashmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index f38706216f..36ff07bd4b 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -110,7 +110,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
hashmap_add(&map, &entries[i]->ent);
}
- hashmap_free(&map);
+ hashmap_clear(&map);
}
} else {
/* test map lookups */
@@ -130,7 +130,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
}
}
- hashmap_free(&map);
+ hashmap_clear(&map);
}
}
@@ -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) {
@@ -262,6 +261,6 @@ int cmd__hashmap(int argc, const char **argv)
}
strbuf_release(&line);
- hashmap_free_entries(&map, struct test_entry, ent);
+ hashmap_clear_and_free(&map, struct test_entry, ent);
return 0;
}