mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-08 13:05:22 +08:00
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:
9 files changed
+44
-127
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user