From b6c5241606e67b57470e86ccf547d4ab90008a1d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Oct 2019 23:30:30 +0000 Subject: hashmap_get takes "const struct hashmap_entry *" This is less error-prone than "const void *" as the compiler now detects invalid types being passed. Signed-off-by: Eric Wong Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- blame.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'blame.c') diff --git a/blame.c b/blame.c index 4d20aee435..73ffb59403 100644 --- a/blame.c +++ b/blame.c @@ -419,7 +419,7 @@ static void get_fingerprint(struct fingerprint *result, continue; hashmap_entry_init(&entry->entry, hash); - found_entry = hashmap_get(&result->map, entry, NULL); + found_entry = hashmap_get(&result->map, &entry->entry, NULL); if (found_entry) { found_entry->count += 1; } else { @@ -452,7 +452,7 @@ static int fingerprint_similarity(struct fingerprint *a, struct fingerprint *b) hashmap_iter_init(&b->map, &iter); while ((entry_b = hashmap_iter_next(&iter))) { - if ((entry_a = hashmap_get(&a->map, entry_b, NULL))) { + if ((entry_a = hashmap_get(&a->map, &entry_b->entry, NULL))) { intersection += entry_a->count < entry_b->count ? entry_a->count : entry_b->count; } @@ -471,7 +471,7 @@ static void fingerprint_subtract(struct fingerprint *a, struct fingerprint *b) hashmap_iter_init(&b->map, &iter); while ((entry_b = hashmap_iter_next(&iter))) { - if ((entry_a = hashmap_get(&a->map, entry_b, NULL))) { + if ((entry_a = hashmap_get(&a->map, &entry_b->entry, NULL))) { if (entry_a->count <= entry_b->count) hashmap_remove(&a->map, entry_b, NULL); else -- cgit v1.2.1