chiark / gitweb /
first try at implementing job creation
[elogind.git] / hashmap.c
index 4db61732fae566011e06af51ae0b9de24ba37f74..c55a07a8846534b72c39e20e4008405edf9ab316 100644 (file)
--- a/hashmap.c
+++ b/hashmap.c
@@ -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);