lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r804516 - /lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
Date Sat, 15 Aug 2009 19:09:35 GMT
Author: markrmiller
Date: Sat Aug 15 19:09:34 2009
New Revision: 804516

URL: http://svn.apache.org/viewvc?rev=804516&view=rev
Log:
change PositionCheckingMap to use an entry iterator in putAll rather than keyset - faster

Modified:
    lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java

Modified: lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java?rev=804516&r1=804515&r2=804516&view=diff
==============================================================================
--- lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
(original)
+++ lucene/java/trunk/contrib/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
Sat Aug 15 19:09:34 2009
@@ -433,11 +433,10 @@
   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());
       }
     }
 



Mime
View raw message