summaryrefslogtreecommitdiff
path: root/blame.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 01:20:10 (GMT)
commitb6c5241606e67b57470e86ccf547d4ab90008a1d (patch)
tree1c038790abd92afde1f8a256c2f0ac37ec19f69c /blame.c
parentb94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70 (diff)
downloadgit-b6c5241606e67b57470e86ccf547d4ab90008a1d.zip
git-b6c5241606e67b57470e86ccf547d4ab90008a1d.tar.gz
git-b6c5241606e67b57470e86ccf547d4ab90008a1d.tar.bz2
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 <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/blame.c b/blame.c
index 4d20aee..73ffb59 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