mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
hashmap: Add pa_hashmap_remove_all()
Slightly nicer than using pa_hashmap_steal_first() in a loop.
This commit is contained in:
parent
061878b5a4
commit
31ee1a7d54
7 changed files with 23 additions and 22 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue