From 8a973d0bb398d6d83d6c048acecc750d01bd7234 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Oct 2019 23:30:39 +0000 Subject: hashmap: hashmap_{put,remove} return hashmap_entry * And add *_entry variants to perform container_of as necessary to simplify most callers. Signed-off-by: Eric Wong Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- range-diff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'range-diff.c') diff --git a/range-diff.c b/range-diff.c index c51cfd5556..e5e7820bfe 100644 --- a/range-diff.c +++ b/range-diff.c @@ -229,7 +229,9 @@ static void find_exact_matches(struct string_list *a, struct string_list *b) util->patch = b->items[i].string; util->diff = util->patch + util->diff_offset; hashmap_entry_init(&util->e, strhash(util->diff)); - other = hashmap_remove(&map, &util->e, NULL); + other = hashmap_remove_entry(&map, util, NULL, + struct patch_util, + e /* member name */); if (other) { if (other->matching >= 0) BUG("already assigned!"); -- cgit v1.2.1