Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2021-03-17 06:17:19 -0400
committerNiraj Modi2021-03-23 02:07:02 -0400
commit033dc6b4b62f92b80681b20ff2f84af0ae0a116f (patch)
tree3ca59499113f09e4edde892be60f9db707186af5 /examples
parentf920b7953ad6e79a6b6eb2c424406052c56acd91 (diff)
downloadeclipse.platform.swt-033dc6b4b62f92b80681b20ff2f84af0ae0a116f.tar.gz
eclipse.platform.swt-033dc6b4b62f92b80681b20ff2f84af0ae0a116f.tar.xz
eclipse.platform.swt-033dc6b4b62f92b80681b20ff2f84af0ae0a116f.zip
Break loop early in TextEditor example
Done with JDT Cleanup exit loop early Change-Id: Id138ee352d44becb6d7b5405ba4f913c77efee9c Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
index 0d499fe0d0..304a7c9fe2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
@@ -860,7 +860,10 @@ public class TextEditor {
for (StyleRange rangeToDispose : ranges) {
boolean disposeFont = true;
for (StyleRange range : allRanges) {
- if (disposeFont && rangeToDispose.font == range.font) disposeFont = false;
+ if (disposeFont && rangeToDispose.font == range.font) {
+ disposeFont = false;
+ break;
+ }
}
if (disposeFont && rangeToDispose.font != textFont && rangeToDispose.font != null) rangeToDispose.font.dispose();

Back to the top