LUCENE-8558: Replace O(n) lookup with O(1) lookup in PerFieldMergeState#FilterFieldInfos

This commit is contained in:
Simon Willnauer 2018-11-07 20:20:42 +01:00
parent f2cb93605c
commit ff1df8a15c
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ final class PerFieldMergeState {
this.filteredNames = new HashSet<>(filterFields);
this.filtered = new ArrayList<>(filterFields.size());
for (FieldInfo fi : src) {
if (filterFields.contains(fi.name)) {
if (this.filteredNames.contains(fi.name)) {
this.filtered.add(fi);
hasVectors |= fi.hasVectors();
hasProx |= fi.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0;