summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:39 +0000
committerJunio C Hamano <gitster@pobox.com>2019-10-07 10:20:11 +0900
commit8a973d0bb398d6d83d6c048acecc750d01bd7234 (patch)
treec4987af10c66582df750927a060b13995dafd84a /remote.c
parent87571c3f71ba41d89eef5202f8589daa26f984ca (diff)
downloadgit-8a973d0bb398d6d83d6c048acecc750d01bd7234.tar.gz
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 'remote.c')
-rw-r--r--remote.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index fa9cadcfbd..5fcddcd88d 100644
--- a/remote.c
+++ b/remote.c
@@ -162,7 +162,8 @@ static struct remote *make_remote(const char *name, int len)
remotes[remotes_nr++] = ret;
hashmap_entry_init(&ret->ent, lookup_entry.hash);
- replaced = hashmap_put(&remotes_hash, &ret->ent);
+ replaced = hashmap_put_entry(&remotes_hash, ret, struct remote,
+ ent /* member name */);
assert(replaced == NULL); /* no previous entry overwritten */
return ret;
}