lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r1144241 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java
Date Fri, 08 Jul 2011 10:32:06 GMT
Author: simonw
Date: Fri Jul  8 10:32:06 2011
New Revision: 1144241

URL: http://svn.apache.org/viewvc?rev=1144241&view=rev
Log:
use short-circuit logic to save extra comparsion & method invocation in BlockTermsReader

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java?rev=1144241&r1=1144240&r2=1144241&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/BlockTermsReader.java
Fri Jul  8 10:32:06 2011
@@ -34,7 +34,6 @@ import org.apache.lucene.index.SegmentIn
 import org.apache.lucene.index.TermState;
 import org.apache.lucene.index.Terms;
 import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.index.codecs.standard.StandardPostingsReader; // javadocs
 import org.apache.lucene.store.ByteArrayDataInput;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
@@ -828,12 +827,12 @@ public class BlockTermsReader extends Fi
         postingsReader.readTermsBlock(in, fieldInfo, state);
 
         blocksSinceSeek++;
-        indexIsCurrent &= (blocksSinceSeek < indexReader.getDivisor());
+        indexIsCurrent = indexIsCurrent && (blocksSinceSeek < indexReader.getDivisor());
         //System.out.println("  indexIsCurrent=" + indexIsCurrent);
 
         return true;
       }
-
+     
       private void decodeMetaData() throws IOException {
         //System.out.println("BTR.decodeMetadata mdUpto=" + metaDataUpto + " vs termCount="
+ state.termCount + " state=" + state);
         if (!seekPending) {



Mime
View raw message