diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-10 18:34:20 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2015-08-10 18:34:20 +0900 |
commit | 766427de0c04c64085c5ed907e3fdcc6124fa2dd (patch) | |
tree | b131c9e5354b17c3ae976e3f3d05b7ac77cb2788 /src/pattern.go | |
parent | a7b75c99a5c2dd76163e229a4b6f9f49401272e0 (diff) |
Fix --with-nth performance; avoid regex if possible
Close #317
Diffstat (limited to 'src/pattern.go')
-rw-r--r-- | src/pattern.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pattern.go b/src/pattern.go index 990450a9..f83861ee 100644 --- a/src/pattern.go +++ b/src/pattern.go @@ -42,7 +42,7 @@ type Pattern struct { text []rune terms []term hasInvTerm bool - delimiter *regexp.Regexp + delimiter Delimiter nth []Range procFun map[termType]func(bool, []rune, []rune) (int, int) } @@ -71,7 +71,7 @@ func clearChunkCache() { // BuildPattern builds Pattern object from the given arguments func BuildPattern(mode Mode, caseMode Case, - nth []Range, delimiter *regexp.Regexp, runes []rune) *Pattern { + nth []Range, delimiter Delimiter, runes []rune) *Pattern { var asString string switch mode { |