Skip to content

Commit 3783aad

Browse files
stefanbellergitster
authored andcommitted
diff.c: do not pass diff options as keydata to hashmap
When we initialize the hashmap, we give it a pointer to the diff_options, which it then passes along to each call of the hashmap_cmp_fn function. There's no need to pass it a second time as the "keydata" parameter, and our comparison functions never look at keydata. This was a mistake left over from an earlier round of 2e2d5ac (diff.c: color moved lines differently, 2017-06-30), before hashmap learned to pass the data pointer for us. Explanation-by: Jeff King <[email protected]> Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74cfa7b commit 3783aad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,13 @@ static void mark_color_as_moved(struct diff_options *o,
842842
case DIFF_SYMBOL_PLUS:
843843
hm = del_lines;
844844
key = prepare_entry(o, n);
845-
match = hashmap_get(hm, key, o);
845+
match = hashmap_get(hm, key, NULL);
846846
free(key);
847847
break;
848848
case DIFF_SYMBOL_MINUS:
849849
hm = add_lines;
850850
key = prepare_entry(o, n);
851-
match = hashmap_get(hm, key, o);
851+
match = hashmap_get(hm, key, NULL);
852852
free(key);
853853
break;
854854
default:

0 commit comments

Comments
 (0)