diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java index 13f1463d0db..bb65f991c93 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java @@ -454,7 +454,7 @@ final class Lucene90DocValuesConsumer extends DocValuesConsumer { for (long v : sortedUniqueValues) { meta.writeLong(v); // table[] entry } - encode = new LongIntHashMap(); + encode = new LongIntHashMap(sortedUniqueValues.length); for (int i = 0; i < sortedUniqueValues.length; ++i) { encode.put(sortedUniqueValues[i], i); }