hashmap_remove 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:
Eric Wong
2019-10-06 23:30:31 +00:00
committed by Junio C Hamano
parent b6c5241606
commit 28ee794128
9 changed files with 11 additions and 10 deletions

View File

@ -218,7 +218,8 @@ void hashmap_add(struct hashmap *map, struct hashmap_entry *entry)
}
}
void *hashmap_remove(struct hashmap *map, const void *key, const void *keydata)
void *hashmap_remove(struct hashmap *map, const struct hashmap_entry *key,
const void *keydata)
{
struct hashmap_entry *old;
struct hashmap_entry **e = find_entry_ptr(map, key, keydata);