diff options
Diffstat (limited to 'hashmap.c')
-rw-r--r-- | hashmap.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -106,12 +106,19 @@ void hashmap_free(Hashmap*h) { if (!h) return; - while (h->iterate_list_head) - remove_entry(h, h->iterate_list_head); + hashmap_clear(h); free(h); } +void hashmap_clear(Hashmap *h) { + if (!h) + return; + + while (h->iterate_list_head) + remove_entry(h, h->iterate_list_head); +} + static struct hashmap_entry *hash_scan(Hashmap *h, unsigned hash, const void *key) { struct hashmap_entry *e; assert(h); |