summaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 01:20:11 (GMT)
commit8a973d0bb398d6d83d6c048acecc750d01bd7234 (patch)
treec4987af10c66582df750927a060b13995dafd84a /range-diff.c
parent87571c3f71ba41d89eef5202f8589daa26f984ca (diff)
downloadgit-8a973d0bb398d6d83d6c048acecc750d01bd7234.zip
git-8a973d0bb398d6d83d6c048acecc750d01bd7234.tar.gz
git-8a973d0bb398d6d83d6c048acecc750d01bd7234.tar.bz2
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 <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/range-diff.c b/range-diff.c
index c51cfd5..e5e7820 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!");