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.
This commit is contained in:
Benjamin Otte 2011-07-07 08:47:25 +02:00
parent 1a241f2348
commit c8e2cd27e9

View File

@ -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