hashmap: hashmap_contains does not need hashmap_entry

This commit is contained in:
Lukas Nykryn 2012-08-23 12:21:55 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 403a56bf81
commit 9f89986d2b

View File

@ -380,14 +380,13 @@ void* hashmap_get(Hashmap *h, const void *key) {
bool hashmap_contains(Hashmap *h, const void *key) {
unsigned hash;
struct hashmap_entry *e;
if (!h)
return false;
hash = h->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(h, hash, key)))
if (!hash_scan(h, hash, key))
return false;
return true;