diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2013-02-12 21:36:56 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2013-02-16 01:17:04 +0200 |
commit | 31ee1a7d54f6ba6eb96a9ae38ad9dfda72c67673 (patch) | |
tree | 8c2e890febbbff14ec8967138779149d798fffad /src/pulsecore/database-simple.c | |
parent | 061878b5a47ed9aa05d12430b039874b63c29a84 (diff) | |
download | pulseaudio-31ee1a7d54f6ba6eb96a9ae38ad9dfda72c67673.tar.gz |
hashmap: Add pa_hashmap_remove_all()
Slightly nicer than using pa_hashmap_steal_first() in a loop.
Diffstat (limited to 'src/pulsecore/database-simple.c')
-rw-r--r-- | src/pulsecore/database-simple.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/pulsecore/database-simple.c b/src/pulsecore/database-simple.c index 5dd3ac9b6..91c1b4570 100644 --- a/src/pulsecore/database-simple.c +++ b/src/pulsecore/database-simple.c @@ -339,12 +339,10 @@ int pa_database_unset(pa_database *database, const pa_datum *key) { int pa_database_clear(pa_database *database) { simple_data *db = (simple_data*)database; - entry *e; pa_assert(db); - while ((e = pa_hashmap_steal_first(db->map))) - free_entry(e); + pa_hashmap_remove_all(db->map, (pa_free_cb_t) free_entry); return 0; } |