mirror of https://github.com/apache/lucene.git
LUCENE-2588: make sure minPrefix never exceeds current term's length
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@983151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
98c139d717
commit
c2ad126364
|
@ -108,7 +108,7 @@ public class SimpleStandardTermsIndexWriter extends StandardTermsIndexWriter {
|
|||
// we can safely strip off the non-distinguishing
|
||||
// suffix to save RAM in the loaded terms index.
|
||||
final int limit = Math.min(lastTerm.length, text.length);
|
||||
int minPrefixDiff = 1+lastTerm.length;
|
||||
int minPrefixDiff = Math.min(1+lastTerm.length, text.length);
|
||||
for(int byteIdx=0;byteIdx<limit;byteIdx++) {
|
||||
if (lastTerm.bytes[lastTerm.offset+byteIdx] != text.bytes[text.offset+byteIdx]) {
|
||||
minPrefixDiff = byteIdx+1;
|
||||
|
|
Loading…
Reference in New Issue