Skip to content

Commit 5fb1fb4

Browse files
committed
Improve performance for large selection
In a custom RCP application I noticed that selecting a huge amount of files (by holding Shift-Scroll down for some seconds) gets slower with the growing size of the selection. We should short-circuit the evaluation the moment the overall result is known to be false.
1 parent be54f35 commit 5fb1fb4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bundles/org.eclipse.ui.navigator/src/org/eclipse/ui/internal/navigator/actions/CommonActionProviderDescriptor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ public boolean isEnabledFor(IStructuredSelection aStructuredSelection) {
236236
context.setAllowPluginActivation(true);
237237
if (NavigatorPlugin.safeEvaluate(enablement, context) != EvaluationResult.TRUE) {
238238
isEnabled = false;
239+
break;
239240
}
240241
}
241242
if (!isEnabled) {

0 commit comments

Comments
 (0)