Further reduce unnecessary rune array conversion

I was too quick to release 0.16.9, this commit makes --ansi processing
even faster.
This commit is contained in:
Junegunn Choi
2017-07-21 17:29:14 +09:00
parent 06301c7847
commit bd98f988f0
6 changed files with 10 additions and 11 deletions

View File

@@ -17,7 +17,7 @@ func assertMatch2(t *testing.T, fun Algo, caseSensitive, normalize, forward bool
if !caseSensitive {
pattern = strings.ToLower(pattern)
}
res, pos := fun(caseSensitive, normalize, forward, util.RunesToChars([]rune(input)), []rune(pattern), true, nil)
res, pos := fun(caseSensitive, normalize, forward, util.ToChars([]byte(input)), []rune(pattern), true, nil)
var start, end int
if pos == nil || len(*pos) == 0 {
start = res.Start