summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-07 01:20:12 (GMT)
commit404ab78e39fc74c4eb604b6003642ed264f687a6 (patch)
tree54cea276f612f84304b9420257a8a667d02ccbbe /remote.c
parent23dee69f53cf5024ca79e0b707dcb03c63f33bef (diff)
downloadgit-404ab78e39fc74c4eb604b6003642ed264f687a6.zip
git-404ab78e39fc74c4eb604b6003642ed264f687a6.tar.gz
git-404ab78e39fc74c4eb604b6003642ed264f687a6.tar.bz2
hashmap: remove type arg from hashmap_{get,put,remove}_entry
Since these macros already take a `keyvar' pointer of a known type, we can rely on OFFSETOF_VAR to get the correct offset without relying on non-portable `__typeof__' and `offsetof'. Argument order is also rearranged, so `keyvar' and `member' are sequential as they are used as: `keyvar->member' 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, 1 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index 5fcddcd..5c4666b 100644
--- a/remote.c
+++ b/remote.c
@@ -162,8 +162,7 @@ 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_entry(&remotes_hash, ret, struct remote,
- ent /* member name */);
+ replaced = hashmap_put_entry(&remotes_hash, ret, ent);
assert(replaced == NULL); /* no previous entry overwritten */
return ret;
}