From ff1df8a15c6eaed81ad7c033014a173175383e5d Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 7 Nov 2018 20:20:42 +0100 Subject: [PATCH] LUCENE-8558: Replace O(n) lookup with O(1) lookup in PerFieldMergeState#FilterFieldInfos --- .../org/apache/lucene/codecs/perfield/PerFieldMergeState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldMergeState.java b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldMergeState.java index 291a384608d..99a04da0422 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldMergeState.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldMergeState.java @@ -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;