[gnome-builder] tree: use g_set_object()



commit ac1d75c418e5d81b0e96313bd481a6407f60ff2d
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 15 17:42:47 2015 -0700

    tree: use g_set_object()

 src/tree/gb-tree-node.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/tree/gb-tree-node.c b/src/tree/gb-tree-node.c
index 27e4b69..0bb6a74 100644
--- a/src/tree/gb-tree-node.c
+++ b/src/tree/gb-tree-node.c
@@ -276,12 +276,8 @@ gb_tree_node_set_item (GbTreeNode *node,
   g_return_if_fail (GB_IS_TREE_NODE (node));
   g_return_if_fail (!item || G_IS_OBJECT (item));
 
-  if (item != node->priv->item)
-    {
-      g_clear_object (&node->priv->item);
-      node->priv->item = item ? g_object_ref (item) : NULL;
-      g_object_notify_by_pspec (G_OBJECT (node), gParamSpecs [PROP_ITEM]);
-    }
+  if (g_set_object (&node->priv->item, item))
+    g_object_notify_by_pspec (G_OBJECT (node), gParamSpecs [PROP_ITEM]);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]