summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Eric Wong <e@80x24.org>2019-10-06 23:30:42 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-07 10:20:12 +0900
commit404ab78e39fc74c4eb604b6003642ed264f687a6 (patch)
tree54cea276f612f84304b9420257a8a667d02ccbbe /config.c
parentOFFSETOF_VAR macro to simplify hashmap iterators (diff)
downloadtgif-404ab78e39fc74c4eb604b6003642ed264f687a6.tar.xz
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 'config.c')
-rw-r--r--config.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/config.c b/config.c
index 77ed00bfbf..a4fa464ed2 100644
--- a/config.c
+++ b/config.c
@@ -1863,8 +1863,7 @@ static struct config_set_element *configset_find_element(struct config_set *cs,
hashmap_entry_init(&k.ent, strhash(normalized_key));
k.key = normalized_key;
- found_entry = hashmap_get_entry(&cs->config_hash, &k, NULL,
- struct config_set_element, ent);
+ found_entry = hashmap_get_entry(&cs->config_hash, &k, ent, NULL);
free(normalized_key);
return found_entry;
}