summaryrefslogtreecommitdiff
path: root/hashmap.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-19 04:15:20 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-19 04:15:20 +0100
commit11dd41ce4b465f6260ce68aa050a488f88f694eb (patch)
tree32cf857bcd71798adc6184dd24fe358ae0048188 /hashmap.c
parent42f4e3c4413ad35e3815f25211fee95d775488a7 (diff)
first try at implementing job creation
Diffstat (limited to 'hashmap.c')
-rw-r--r--hashmap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hashmap.c b/hashmap.c
index 4db61732fa..c55a07a884 100644
--- 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);