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 --- remote.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'remote.c') 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; } -- cgit v1.2.3