From ba7a0a01887d2558ee7a2152834bd33a1f901947 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 19 Nov 2011 13:10:05 +0100 Subject: [PATCH] rbtree: Use gtk_rbnode_adjust() more. Make _gtk_rbtree_node_set_height() use it. --- gtk/gtkrbtree.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c index 9f281be200..b62a0f3dc1 100644 --- a/gtk/gtkrbtree.c +++ b/gtk/gtkrbtree.c @@ -603,22 +603,12 @@ _gtk_rbtree_node_set_height (GtkRBTree *tree, gint height) { gint diff = height - GTK_RBNODE_GET_HEIGHT (node); - GtkRBNode *tmp_node = node; - GtkRBTree *tmp_tree = tree; if (diff == 0) return; - while (tmp_tree && tmp_node && tmp_node != tmp_tree->nil) - { - tmp_node->offset += diff; - tmp_node = tmp_node->parent; - if (tmp_node == tmp_tree->nil) - { - tmp_node = tmp_tree->parent_node; - tmp_tree = tmp_tree->parent_tree; - } - } + gtk_rbnode_adjust (tree, node, 0, 0, diff); + #ifdef G_ENABLE_DEBUG if (gtk_get_debug_flags () & GTK_DEBUG_TREE) _gtk_rbtree_test (G_STRLOC, tree);