rewrite map access to take advantage of optimization
This commit is contained in:
parent
890b1abfe6
commit
530613a239
|
@ -32,8 +32,7 @@ func (f *StopTokensFilter) Filter(input analysis.TokenStream) analysis.TokenStre
|
||||||
rv := make(analysis.TokenStream, 0, len(input))
|
rv := make(analysis.TokenStream, 0, len(input))
|
||||||
|
|
||||||
for _, token := range input {
|
for _, token := range input {
|
||||||
tokenTerm := string(token.Term)
|
_, isStopToken := f.stopTokens[string(token.Term)]
|
||||||
_, isStopToken := f.stopTokens[tokenTerm]
|
|
||||||
if !isStopToken {
|
if !isStopToken {
|
||||||
rv = append(rv, token)
|
rv = append(rv, token)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user