Treeview: Slight simplification of treeview_walk_internal().

This commit is contained in:
Michael Drake 2017-09-11 19:52:07 +01:00
parent 0a0ad71bdb
commit 45a7e6269b

View File

@ -566,13 +566,12 @@ treeview_walk_internal(treeview_node *root,
node = root; node = root;
parent = node->parent; parent = node->parent;
next_sibling = node->next_sib; next_sibling = node->next_sib;
child = (!skip_children && child = (full || (node->flags & TV_NFLAGS_EXPANDED)) ?
(full || (node->flags & TV_NFLAGS_EXPANDED))) ?
node->children : NULL; node->children : NULL;
while (node != NULL) { while (node != NULL) {
if (child != NULL) { if (child != NULL && !skip_children) {
/* Down to children */ /* Down to children */
node = child; node = child;
} else { } else {
@ -639,7 +638,6 @@ treeview_walk_internal(treeview_node *root,
return NSERROR_OK; return NSERROR_OK;
} }
} }
child = skip_children ? NULL : child;
} }
return NSERROR_OK; return NSERROR_OK;
} }