diff options
Diffstat (limited to 'src/hashmap.c')
-rw-r--r-- | src/hashmap.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hashmap.c b/src/hashmap.c index 51f00131f4..4b187057ec 100644 --- a/src/hashmap.c +++ b/src/hashmap.c @@ -476,6 +476,21 @@ void* hashmap_steal_first(Hashmap *h) { return data; } +void* hashmap_steal_first_key(Hashmap *h) { + void *key; + + if (!h) + return NULL; + + if (!h->iterate_list_head) + return NULL; + + key = (void*) h->iterate_list_head->key; + remove_entry(h, h->iterate_list_head); + + return key; +} + unsigned hashmap_size(Hashmap *h) { if (!h) |