Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-05-10 09:29:35 +0000
committerMickael Istria2017-02-02 18:23:49 +0000
commit987947306302e3c4960fc6f7d57b82e2a5a2435a (patch)
tree7bafdb64047edf0dea950efefefe8ff9a903c1aa /org.eclipse.ui.workbench.texteditor
parentfab00d8dab78d07b1caddd2a2c481c6c8e28510c (diff)
downloadeclipse.platform.text-987947306302e3c4960fc6f7d57b82e2a5a2435a.tar.gz
eclipse.platform.text-987947306302e3c4960fc6f7d57b82e2a5a2435a.tar.xz
eclipse.platform.text-987947306302e3c4960fc6f7d57b82e2a5a2435a.zip
Bug 493306 - Inefficient use of keySet iterator instead of entrySet
iterator in eclipse.text Change-Id: I5f43ac955ca602846b2f3680b2e63023e1c23368 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingReconcileStrategy.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingReconcileStrategy.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingReconcileStrategy.java
index 92ec1cfe3d9..6dd4ee3c381 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingReconcileStrategy.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/spelling/SpellingReconcileStrategy.java
@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -100,11 +101,11 @@ public class SpellingReconcileStrategy implements IReconcilingStrategy, IReconci
if (fAnnotationModel instanceof IAnnotationModelExtension)
((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(annotationsToRemove, fAddAnnotations);
else {
- for (int i= 0; i < annotationsToRemove.length; i++)
- fAnnotationModel.removeAnnotation(annotationsToRemove[i]);
- for (iter= fAddAnnotations.keySet().iterator(); iter.hasNext();) {
- Annotation annotation= iter.next();
- fAnnotationModel.addAnnotation(annotation, fAddAnnotations.get(annotation));
+ for (Annotation element : annotationsToRemove) {
+ fAnnotationModel.removeAnnotation(element);
+ }
+ for (Entry<Annotation, Position> entry : fAddAnnotations.entrySet()) {
+ fAnnotationModel.addAnnotation(entry.getKey(), entry.getValue());
}
}
}

Back to the top