diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene101/Lucene101PostingsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene101/Lucene101PostingsReader.java index 004540ad584..1efcdf554dd 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene101/Lucene101PostingsReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene101/Lucene101PostingsReader.java @@ -297,7 +297,7 @@ public final class Lucene101PostingsReader extends PostingsReaderBase { private ForDeltaUtil forDeltaUtil; private PForUtil pforUtil; - private final int[] docBuffer = new int[BLOCK_SIZE + 1]; + private final int[] docBuffer = new int[BLOCK_SIZE]; private int doc; // doc we last read @@ -418,10 +418,6 @@ public final class Lucene101PostingsReader extends PostingsReaderBase { this.needsImpacts = needsImpacts; needsDocsAndFreqsOnly = needsPos == false && needsImpacts == false; - // We set the last element of docBuffer to NO_MORE_DOCS, it helps save conditionals in - // advance() - docBuffer[BLOCK_SIZE] = NO_MORE_DOCS; - if (needsFreq == false) { Arrays.fill(freqBuffer, 1); } @@ -586,7 +582,6 @@ public final class Lucene101PostingsReader extends PostingsReaderBase { prevDocID = docBuffer[BLOCK_SIZE - 1]; docBufferUpto = 0; posDocBufferUpto = 0; - assert docBuffer[docBufferSize] == NO_MORE_DOCS; } private void refillRemainder() throws IOException {