Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2018-02-13 04:28:32 -0500
committerLars Vogel2018-02-13 06:40:05 -0500
commit5f9b6cbb6603918dbda75cd1398a64799f62d49d (patch)
treed1a2659da21b450ca3ce7f73e3160784482f4b2b /org.eclipse.text
parent0c046c2f7805a1239aa978cee2ab21b1577307ed (diff)
downloadeclipse.platform.text-5f9b6cbb6603918dbda75cd1398a64799f62d49d.tar.gz
eclipse.platform.text-5f9b6cbb6603918dbda75cd1398a64799f62d49d.tar.xz
eclipse.platform.text-5f9b6cbb6603918dbda75cd1398a64799f62d49d.zip
Bug 531084 - Inefficient use of keySet iterator instead of entrySetI20180214-2000I20180213-2000
iterator in AbstractDocument Change-Id: I8756ba5c5360feea7f2a6f575aa1bf7b5d2ada53 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.text')
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
index 41b179b6b..b4390a743 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java
@@ -1528,10 +1528,9 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension,
protected final void stopRewriteSessionOnPartitioners(DocumentRewriteSession session) {
if (fDocumentPartitioners != null) {
DocumentPartitioningChangedEvent event= new DocumentPartitioningChangedEvent(this);
- Iterator<String> e= fDocumentPartitioners.keySet().iterator();
- while (e.hasNext()) {
- String partitioning= e.next();
- IDocumentPartitioner partitioner= fDocumentPartitioners.get(partitioning);
+ for (Entry<String, IDocumentPartitioner> entry : fDocumentPartitioners.entrySet()) {
+ String partitioning = entry.getKey();
+ IDocumentPartitioner partitioner= entry.getValue();
if (partitioner instanceof IDocumentPartitionerExtension3) {
IDocumentPartitionerExtension3 extension= (IDocumentPartitionerExtension3) partitioner;
extension.stopRewriteSession(session);

Back to the top