diff options
author | Jens Georg <mail@jensge.org> | 2016-06-05 19:29:27 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2016-06-05 23:28:30 +0200 |
commit | 735a3140a8a4dbdb29a41b0a0645806c2247eae0 (patch) | |
tree | d73826f46a8a3338f750607526511eb2b5b9ecfb | |
parent | 7748843e18a6393464556e1f5c76e4deac81aace (diff) | |
download | gupnp-tools-735a3140a8a4dbdb29a41b0a0645806c2247eae0.tar.gz |
av-cp: Minor simplificaton
Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r-- | src/av-cp/playlist-treeview.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/av-cp/playlist-treeview.c b/src/av-cp/playlist-treeview.c index 2179e64..f198e37 100644 --- a/src/av-cp/playlist-treeview.c +++ b/src/av-cp/playlist-treeview.c @@ -363,20 +363,12 @@ compare_media_server (GtkTreeModel *model, gtk_tree_model_get (model, iter, 2, &info, -1); - if (info) { - if (GUPNP_IS_DEVICE_PROXY (info)) { - const char *device_udn; - - device_udn = gupnp_device_info_get_udn (info); - - if (device_udn && strcmp (device_udn, udn) == 0) { - found = TRUE; - } - } - - g_object_unref (info); + if (info && GUPNP_IS_DEVICE_PROXY (info)) { + found = g_strcmp0 (gupnp_device_info_get_udn (info), udn) == 0; } + g_clear_object (&info); + return found; } @@ -445,14 +437,11 @@ compare_container (GtkTreeModel *model, return found; } - if (container_id == NULL) - return found; - - if (strcmp (container_id, id) == 0) { + if (g_strcmp0 (container_id, id) == 0) { found = TRUE; } - g_free (container_id); + g_clear_pointer (&container_id, g_free); return found; } |