[gnome-builder/gnome-builder-3-18] tree: make finding parent iter more readable
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] tree: make finding parent iter more readable
- Date: Thu, 15 Oct 2015 14:42:56 +0000 (UTC)
commit d888eea7ff33d6d380b2e2e23029ac8ff1742e64
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 14 15:23:18 2015 -0700
tree: make finding parent iter more readable
We can remove a branch entirely here.
src/tree/gb-tree.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/tree/gb-tree.c b/src/tree/gb-tree.c
index a51e687..ae854a6 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -499,7 +499,7 @@ gb_tree_add (GbTree *self,
{
GbTreePrivate *priv = gb_tree_get_instance_private (self);
GtkTreePath *path;
- GtkTreeIter *parentptr;
+ GtkTreeIter *parentptr = NULL;
GtkTreeIter iter;
GtkTreeIter parent;
@@ -512,11 +512,7 @@ gb_tree_add (GbTree *self,
g_object_ref_sink (child);
- if (node == priv->root)
- {
- parentptr = NULL;
- }
- else
+ if (node != priv->root)
{
path = gb_tree_node_get_path (node);
gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->store), &parent, path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]