[pulseaudio-discuss] [PATCH 2/2] stream-restore: Don't verify entry validity needlessly.

Tanu Kaskinen tanuk at iki.fi
Fri Jan 6 06:23:06 PST 2012


clean_up_db() makes sure that all entries in the database
are valid.
---
 src/modules/module-stream-restore.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index d1c8728..23889ca 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -2460,22 +2460,14 @@ int pa__init(pa_module*m) {
         pa_datum next_key;
         char *name;
         struct dbus_entry *de;
-        struct entry *e;
-
-        done = !pa_database_next(u->database, &key, &next_key, NULL);
 
         name = pa_xstrndup(key.data, key.size);
-        pa_datum_free(&key);
-
-        /* Use entry_read() for checking that the entry is valid. */
-        if ((e = entry_read(u, name))) {
-            de = dbus_entry_new(u, name);
-            pa_assert_se(pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0);
-            entry_free(e);
-        }
-
+        de = dbus_entry_new(u, name);
+        pa_assert_se(pa_hashmap_put(u->dbus_entries, de->entry_name, de) == 0);
         pa_xfree(name);
 
+        done = !pa_database_next(u->database, &key, &next_key, NULL);
+        pa_datum_free(&key);
         key = next_key;
     }
 #endif
-- 
1.7.7.3



More information about the pulseaudio-discuss mailing list