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>
This commit is contained in:
committed by
Junio C Hamano
parent
d22245a2e3
commit
f6eb6bdcf2
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user