hashmap: Add pa_hashmap_remove_all()

Slightly nicer than using pa_hashmap_steal_first() in a loop.
This commit is contained in:
Tanu Kaskinen 2013-02-12 21:36:56 +02:00
parent 061878b5a4
commit 31ee1a7d54
7 changed files with 23 additions and 22 deletions

View file

@ -652,11 +652,9 @@ int pa_proplist_contains(pa_proplist *p, const char *key) {
}
void pa_proplist_clear(pa_proplist *p) {
struct property *prop;
pa_assert(p);
while ((prop = pa_hashmap_steal_first(MAKE_HASHMAP(p))))
property_free(prop);
pa_hashmap_remove_all(MAKE_HASHMAP(p), (pa_free_cb_t) property_free);
}
pa_proplist* pa_proplist_copy(const pa_proplist *p) {