diff options
author | Eric Wong <e@80x24.org> | 2019-10-07 02:30:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-07 04:20:12 +0300 |
commit | 404ab78e39fc74c4eb604b6003642ed264f687a6 (patch) | |
tree | 54cea276f612f84304b9420257a8a667d02ccbbe /name-hash.c | |
parent | 23dee69f53cf5024ca79e0b707dcb03c63f33bef (diff) |
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 'name-hash.c')
-rw-r--r-- | name-hash.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/name-hash.c b/name-hash.c index 3cda22b657..ceb1d7bd6f 100644 --- a/name-hash.c +++ b/name-hash.c @@ -37,8 +37,7 @@ static struct dir_entry *find_dir_entry__hash(struct index_state *istate, struct dir_entry key; hashmap_entry_init(&key.ent, hash); key.namelen = namelen; - return hashmap_get_entry(&istate->dir_hash, &key, name, - struct dir_entry, ent); + return hashmap_get_entry(&istate->dir_hash, &key, ent, name); } static struct dir_entry *find_dir_entry(struct index_state *istate, |