diff options
author | Lars Vogel | 2018-02-13 09:28:32 +0000 |
---|---|---|
committer | Lars Vogel | 2018-02-13 11:40:05 +0000 |
commit | 5f9b6cbb6603918dbda75cd1398a64799f62d49d (patch) | |
tree | d1a2659da21b450ca3ce7f73e3160784482f4b2b /org.eclipse.text/src | |
parent | 0c046c2f7805a1239aa978cee2ab21b1577307ed (diff) | |
download | eclipse.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/src')
-rw-r--r-- | org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java | 7 |
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 41b179b6b76..b4390a743a5 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); |