[gupnp-tools] av-cp: Minor simplificaton
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-tools] av-cp: Minor simplificaton
- Date: Sun, 5 Jun 2016 21:29:10 +0000 (UTC)
commit 735a3140a8a4dbdb29a41b0a0645806c2247eae0
Author: Jens Georg <mail jensge org>
Date: Sun Jun 5 19:29:27 2016 +0200
av-cp: Minor simplificaton
Signed-off-by: Jens Georg <mail jensge org>
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]