summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-09-11 18:52:07 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2017-09-18 22:18:44 (GMT)
commit45a7e6269b2328de9178af76ff4aed41c2e69129 (patch)
tree31d7b32273b7ddd119e74df1421eb304136a0822
parent0a0ad71bdb181bb309ba86d283704ba7b0e89dc1 (diff)
downloadnetsurf-45a7e6269b2328de9178af76ff4aed41c2e69129.tar.gz
netsurf-45a7e6269b2328de9178af76ff4aed41c2e69129.tar.bz2
Treeview: Slight simplification of treeview_walk_internal().
-rw-r--r--desktop/treeview.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/desktop/treeview.c b/desktop/treeview.c
index e6dcbc0..a6e3e60 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -566,13 +566,12 @@ treeview_walk_internal(treeview_node *root,
node = root;
parent = node->parent;
next_sibling = node->next_sib;
- child = (!skip_children &&
- (full || (node->flags & TV_NFLAGS_EXPANDED))) ?
+ child = (full || (node->flags & TV_NFLAGS_EXPANDED)) ?
node->children : NULL;
while (node != NULL) {
- if (child != NULL) {
+ if (child != NULL && !skip_children) {
/* Down to children */
node = child;
} else {
@@ -639,7 +638,6 @@ treeview_walk_internal(treeview_node *root,
return NSERROR_OK;
}
}
- child = skip_children ? NULL : child;
}
return NSERROR_OK;
}