Avoid unconditionally storsing input as runes

When --with-nth is used, fzf used to preprocess each line and store the
result as rune array, which was wasteful if the line only contains ascii
characters.
This commit is contained in:
Junegunn Choi committed 2017-07-20 02:44:30 +09:00
1 parent bc9d2abdb6
commit c9f16b6430
9 files changed
+44 -127

No files matched your search

+1 -1
View File
@@ -362,7 +362,7 @@ func (p *Pattern) prepareInput(item *Item) []Token {
return *item.transformed
}
tokens := Tokenize(item.text, p.delimiter)
tokens := Tokenize(item.text.ToString(), p.delimiter)
ret := Transform(tokens, p.nth)
item.transformed = &ret
return ret