mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 23:10:22 +00:00
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:
parent
1a241f2348
commit
c8e2cd27e9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user