Minor refactorings

This commit is contained in:
Junegunn Choi committed 2017-08-26 03:24:42 +09:00
1 parent 329de8f416
commit af809c9661
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -147,7 +147,7 @@ func Tokenize(text string, delimiter Delimiter) []Token {
if delimiter.regex != nil {
for len(text) > 0 {
loc := delimiter.regex.FindStringIndex(text)
if loc == nil {
if len(loc) < 2 {
loc = []int{0, len(text)}
}
last := util.Max(loc[1], 1)