Skip to content
Myr

Remove duplicate code

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 0e0de29 · Browse files · 1 file+1 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−9 removed

  • other:+1 added−9 removed

1 file+1 added−9 removed

modified:src/tokenizer.go+1 added-9 removed
171 unmodified lines
172 }173 return ret174}175176func joinTokensAsRunes(tokens []Token) []rune {177 ret := []rune{}178 for _, token := range tokens {179 ret = append(ret, token.text.ToRunes()...)180 }181 return ret182}183176// Transform is used to transform the input when --with-nth option is given177func Transform(tokens []Token, withNth []Range) []Token {178 transTokens := make([]Token, len(withNth))179 numTokens := len(tokens)
2 unmodified lines
182 minIdx := 0183 if r.begin == r.end {184 idx := r.begin185 if idx == rangeEllipsis {194 parts = append(parts, util.RunesToChars(joinTokensAsRunes(tokens)))186 parts = append(parts, util.RunesToChars(joinTokens(tokens)))187 } else {188 if idx < 0 {189 idx += numTokens + 1190 }
58 unmodified lines