diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-08-18 03:11:54 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-08-18 03:11:54 +0900 |
commit | 01ee335521485e82f0a2eb88cec79908b469b187 (patch) | |
tree | e9c06fc53bcf2cebfbdf21520f768d0f82729c77 /src/tokenizer.go | |
parent | 0e0de29b87fa65c135244e0d1137c4614d4d2d7c (diff) |
Remove duplicate code
Diffstat (limited to 'src/tokenizer.go')
-rw-r--r-- | src/tokenizer.go | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/tokenizer.go b/src/tokenizer.go index e48f48bf..b6aa0c64 100644 --- a/src/tokenizer.go +++ b/src/tokenizer.go @@ -173,14 +173,6 @@ func joinTokens(tokens []Token) []rune { return ret } -func joinTokensAsRunes(tokens []Token) []rune { - ret := []rune{} - for _, token := range tokens { - ret = append(ret, token.text.ToRunes()...) - } - return ret -} - // Transform is used to transform the input when --with-nth option is given func Transform(tokens []Token, withNth []Range) []Token { transTokens := make([]Token, len(withNth)) @@ -191,7 +183,7 @@ func Transform(tokens []Token, withNth []Range) []Token { if r.begin == r.end { idx := r.begin if idx == rangeEllipsis { - parts = append(parts, util.RunesToChars(joinTokensAsRunes(tokens))) + parts = append(parts, util.RunesToChars(joinTokens(tokens))) } else { if idx < 0 { idx += numTokens + 1 |