LUCENE-2197: don't copy CharArraySet in StopFilter

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@898866 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-01-13 18:06:55 +00:00
parent 476d155185
commit 7bdac8e555
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ public final class StopFilter extends TokenFilter {
*/
private StopFilter(Version matchVersion, boolean enablePositionIncrements, TokenStream input, Set<?> stopWords, boolean ignoreCase){
super(input);
this.stopWords = CharArraySet.unmodifiableSet(new CharArraySet(matchVersion, stopWords, ignoreCase));
this.stopWords = stopWords instanceof CharArraySet ? (CharArraySet)stopWords : new CharArraySet(matchVersion, stopWords, ignoreCase);
this.enablePositionIncrements = enablePositionIncrements;
termAtt = addAttribute(TermAttribute.class);
posIncrAtt = addAttribute(PositionIncrementAttribute.class);