Skip to content

Commit 323f82d

Browse files
committed
Only evaluate expand condition once in AnstractTreeViewer
No need to evaluate for every child since the condition applies to the parent item.
1 parent 7308b62 commit 323f82d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -1862,13 +1862,11 @@ private void internalConditionalExpandToLevel(Widget widget, int level,
18621862
}
18631863
if (level == ALL_LEVELS || level > 1) {
18641864
Item[] children = getChildren(widget);
1865-
if (children != null) {
1865+
if (children != null && shouldChildrenExpand.apply(widget).booleanValue()) {
18661866
int newLevel = (level == ALL_LEVELS ? ALL_LEVELS
18671867
: level - 1);
18681868
for (Item element : children) {
1869-
if (shouldChildrenExpand.apply(widget).booleanValue()) {
1870-
internalConditionalExpandToLevel(element, newLevel, shouldChildrenExpand);
1871-
}
1869+
internalConditionalExpandToLevel(element, newLevel, shouldChildrenExpand);
18721870
}
18731871
}
18741872
}

0 commit comments

Comments
 (0)