X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=range-diff.c;h=7fed5a3b4bb54a53f434cf23fb96151e9a8f824d;hb=15d9f3dc6642497b1186e943cdccba3a8f9f0b0e;hp=f2fc1e02c2c74034c3fe1f3c29fcc81458ccb738;hpb=d96e31e3902d615c03471c8566ce89872c3c1a4e;p=thirdparty%2Fgit.git diff --git a/range-diff.c b/range-diff.c index f2fc1e02c2..7fed5a3b4b 100644 --- a/range-diff.c +++ b/range-diff.c @@ -218,8 +218,8 @@ static void find_exact_matches(struct string_list *a, struct string_list *b) util->i = i; util->patch = a->items[i].string; util->diff = util->patch + util->diff_offset; - hashmap_entry_init(util, strhash(util->diff)); - hashmap_add(&map, util); + hashmap_entry_init(&util->e, strhash(util->diff)); + hashmap_add(&map, &util->e); } /* Now try to find exact matches in b */ @@ -229,8 +229,8 @@ static void find_exact_matches(struct string_list *a, struct string_list *b) util->i = i; util->patch = b->items[i].string; util->diff = util->patch + util->diff_offset; - hashmap_entry_init(util, strhash(util->diff)); - other = hashmap_remove(&map, util, NULL); + hashmap_entry_init(&util->e, strhash(util->diff)); + other = hashmap_remove_entry(&map, util, e, NULL); if (other) { if (other->matching >= 0) BUG("already assigned!"); @@ -240,7 +240,7 @@ static void find_exact_matches(struct string_list *a, struct string_list *b) } } - hashmap_free(&map, 0); + hashmap_free(&map); } static void diffsize_consume(void *data, char *line, unsigned long len)