Skip to content

Commit

Permalink
Improve performance for large selection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Bananeweizen authored and HannesWell committed Sep 17, 2024
1 parent 8d647ea commit f8e46c3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public boolean isEnabledFor(IStructuredSelection aStructuredSelection) {
context.setAllowPluginActivation(true);
if (NavigatorPlugin.safeEvaluate(enablement, context) != EvaluationResult.TRUE) {
isEnabled = false;
break;
}
}
if (!isEnabled) {
Expand Down

0 comments on commit f8e46c3

Please sign in to comment.