diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-04-02 08:43:08 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-04-02 08:43:08 +0900 |
| commit | c30e486b648c1540a660802a5015aeca208274fa (patch) | |
| tree | 1be9cd9e2890f3ccfb2e671e89e790e9dccbffd2 /src/tokenizer.go | |
| parent | a575c0c54b653050bdb72b4d046ef05967d95c46 (diff) | |
| download | fzf-c30e486b648c1540a660802a5015aeca208274fa.tar.gz | |
Further performance improvements by removing unnecessary copies
Diffstat (limited to 'src/tokenizer.go')
| -rw-r--r-- | src/tokenizer.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tokenizer.go b/src/tokenizer.go index 9f9e2c19..defe8cce 100644 --- a/src/tokenizer.go +++ b/src/tokenizer.go @@ -91,7 +91,7 @@ func withPrefixLengths(tokens []string, begin int) []Token { prefixLength := begin for idx := range tokens { - chars := util.ToChars([]byte(tokens[idx])) + chars := util.ToChars(sbytes(tokens[idx])) ret[idx] = Token{&chars, int32(prefixLength)} prefixLength += chars.Length() } @@ -187,7 +187,7 @@ func Transform(tokens []Token, withNth []Range) []Token { if r.begin == r.end { idx := r.begin if idx == rangeEllipsis { - chars := util.ToChars([]byte(joinTokens(tokens))) + chars := util.ToChars(sbytes(joinTokens(tokens))) parts = append(parts, &chars) } else { if idx < 0 { |
