diff options
author | Benjamin Otte <otte@redhat.com> | 2011-07-07 08:47:25 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-11-16 04:31:06 +0100 |
commit | c8e2cd27e9c6b6cb558121636d31a60d4d37edb5 (patch) | |
tree | 5b54b0c6a5f5185c902a0bf54e1ef9eb7cd97bd8 /gtk/gtkrbtree.c | |
parent | 1a241f23486e1c285103cc8091bf4905f1ed0155 (diff) | |
download | gtk+-c8e2cd27e9c6b6cb558121636d31a60d4d37edb5.tar.gz |
treeview: Remove special cases when computing parity
The parity of the nil npode is always 0, so no need to check for the nil
node first.
Diffstat (limited to 'gtk/gtkrbtree.c')
-rw-r--r-- | gtk/gtkrbtree.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkrbtree.c b/gtk/gtkrbtree.c index b351eb7fc3..a912530779 100644 --- a/gtk/gtkrbtree.c +++ b/gtk/gtkrbtree.c @@ -1489,9 +1489,8 @@ void _fixup_parity (GtkRBTree *tree, GtkRBNode *node) { node->parity = 1 + - ((node->children != NULL && node->children->root != node->children->nil) ? node->children->root->parity : 0) + - ((node->left != tree->nil) ? node->left->parity : 0) + - ((node->right != tree->nil) ? node->right->parity : 0); + (node->children != NULL ? node->children->root->parity : 0) + + node->left->parity + node->right->parity; } #ifdef G_ENABLE_DEBUG |