summaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/range-diff.c b/range-diff.c
index 24dc435e48..b9950f10c8 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -232,11 +232,9 @@ static int patch_util_cmp(const void *dummy, const struct patch_util *a,
static void find_exact_matches(struct string_list *a, struct string_list *b)
{
- struct hashmap map;
+ struct hashmap map = HASHMAP_INIT((hashmap_cmp_fn)patch_util_cmp, NULL);
int i;
- hashmap_init(&map, (hashmap_cmp_fn)patch_util_cmp, NULL, 0);
-
/* First, add the patches of a to a hash map */
for (i = 0; i < a->nr; i++) {
struct patch_util *util = a->items[i].util;
@@ -266,7 +264,7 @@ static void find_exact_matches(struct string_list *a, struct string_list *b)
}
}
- hashmap_free(&map);
+ hashmap_clear(&map);
}
static void diffsize_consume(void *data, char *line, unsigned long len)