diff options
author | Eric Wong <e@80x24.org> | 2019-10-06 23:30:28 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-07 10:20:10 +0900 |
commit | f6eb6bdcf2719defc3d38e0e2712fa3e18d29e91 (patch) | |
tree | c66cbc464d075f07fedf1ab338a33fbc66c46638 /hashmap.c | |
parent | d22245a2e360d2e708ca37169be8eb5a5899b98d (diff) | |
download | git-f6eb6bdcf2719defc3d38e0e2712fa3e18d29e91.tar.gz |
hashmap_get_next takes "const struct hashmap_entry *"
This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.
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 'hashmap.c')
-rw-r--r-- | hashmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -191,9 +191,10 @@ void *hashmap_get(const struct hashmap *map, const void *key, const void *keydat return *find_entry_ptr(map, key, keydata); } -void *hashmap_get_next(const struct hashmap *map, const void *entry) +void *hashmap_get_next(const struct hashmap *map, + const struct hashmap_entry *entry) { - struct hashmap_entry *e = ((struct hashmap_entry *) entry)->next; + struct hashmap_entry *e = entry->next; for (; e; e = e->next) if (entry_equals(map, entry, e, NULL)) return e; |