mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Use pa_hashmap_remove_and_free() where appropriate
This commit is contained in:
parent
14e2553185
commit
eca082a93f
14 changed files with 29 additions and 84 deletions
|
|
@ -322,18 +322,11 @@ int pa_database_set(pa_database *database, const pa_datum *key, const pa_datum*
|
|||
|
||||
int pa_database_unset(pa_database *database, const pa_datum *key) {
|
||||
simple_data *db = (simple_data*)database;
|
||||
entry *e;
|
||||
|
||||
pa_assert(db);
|
||||
pa_assert(key);
|
||||
|
||||
e = pa_hashmap_remove(db->map, key);
|
||||
if (!e)
|
||||
return -1;
|
||||
|
||||
free_entry(e);
|
||||
|
||||
return 0;
|
||||
return pa_hashmap_remove_and_free(db->map, key);
|
||||
}
|
||||
|
||||
int pa_database_clear(pa_database *database) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue