Initialize the dictionary of sorted numeric DV with a known size

This commit is contained in:
panguixin 2024-12-04 00:19:35 +08:00
parent 4f08f3dc6f
commit d357bd1b34
1 changed files with 1 additions and 1 deletions

View File

@ -454,7 +454,7 @@ final class Lucene90DocValuesConsumer extends DocValuesConsumer {
for (long v : sortedUniqueValues) { for (long v : sortedUniqueValues) {
meta.writeLong(v); // table[] entry meta.writeLong(v); // table[] entry
} }
encode = new LongIntHashMap(); encode = new LongIntHashMap(sortedUniqueValues.length);
for (int i = 0; i < sortedUniqueValues.length; ++i) { for (int i = 0; i < sortedUniqueValues.length; ++i) {
encode.put(sortedUniqueValues[i], i); encode.put(sortedUniqueValues[i], i);
} }