From c9f16b6430f3b9c9d12ee078e2218e8467c13340 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 20 Jul 2017 02:44:30 +0900 Subject: 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. --- src/options_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/options_test.go') diff --git a/src/options_test.go b/src/options_test.go index 907faf03..d3c93450 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/junegunn/fzf/src/tui" - "github.com/junegunn/fzf/src/util" ) func TestDelimiterRegex(t *testing.T) { @@ -44,7 +43,7 @@ func TestDelimiterRegex(t *testing.T) { func TestDelimiterRegexString(t *testing.T) { delim := delimiterRegexp("*") - tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim) + tokens := Tokenize("-*--*---**---", delim) if delim.regex != nil || tokens[0].text.ToString() != "-*" || tokens[1].text.ToString() != "--*" || @@ -57,7 +56,7 @@ func TestDelimiterRegexString(t *testing.T) { func TestDelimiterRegexRegex(t *testing.T) { delim := delimiterRegexp("--\\*") - tokens := Tokenize(util.RunesToChars([]rune("-*--*---**---")), delim) + tokens := Tokenize("-*--*---**---", delim) if delim.str != nil || tokens[0].text.ToString() != "-*--*" || tokens[1].text.ToString() != "---*" || -- cgit v1.2.3