mirror of https://github.com/apache/lucene.git
LUCENE-5836: when prefix-coding variable length terms, preallocate lastTerm to the correct size
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1611970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d2218a8b85
commit
387ee2a6d3
|
@ -324,7 +324,7 @@ class Lucene49DocValuesConsumer extends DocValuesConsumer implements Closeable {
|
|||
// we could avoid this, but its not much and less overall RAM than the previous approach!
|
||||
RAMOutputStream addressBuffer = new RAMOutputStream();
|
||||
MonotonicBlockPackedWriter termAddresses = new MonotonicBlockPackedWriter(addressBuffer, BLOCK_SIZE);
|
||||
BytesRef lastTerm = new BytesRef();
|
||||
BytesRef lastTerm = new BytesRef(Math.max(0, maxLength));
|
||||
long count = 0;
|
||||
for (BytesRef v : values) {
|
||||
if (count % ADDRESS_INTERVAL == 0) {
|
||||
|
|
Loading…
Reference in New Issue