change PositionCheckingMap to use an entry iterator in putAll rather than keyset - faster

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@804516 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-08-15 19:09:34 +00:00
parent 90c8ef28c8
commit 395c65ad08
1 changed files with 3 additions and 4 deletions

View File

@ -433,11 +433,10 @@ public class WeightedSpanTermExtractor {
static private class PositionCheckingMap extends HashMap {
public void putAll(Map m) {
Iterator it = m.keySet().iterator();
Iterator it = m.entrySet().iterator();
while (it.hasNext()) {
Object key = it.next();
Object val = m.get(key);
this.put(key, val);
Map.Entry entry = (java.util.Map.Entry) it.next();
this.put(entry.getKey(), entry.getValue());
}
}