Fix --with-nth performance; use simpler regular expression

Related #317
This commit is contained in:
Junegunn Choi
2015-08-10 23:47:03 +09:00
parent 766427de0c
commit d0f2c00f9f
5 changed files with 33 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
package fzf
import (
"fmt"
"io/ioutil"
"os"
"regexp"
@@ -284,10 +283,6 @@ func delimiterRegexp(str string) Delimiter {
}
// 3. Pattern as regular expression. Slow.
rx, e = regexp.Compile(fmt.Sprintf("(?:.*?%s)|(?:.+?$)", str))
if e != nil {
errorExit("invalid regular expression: " + e.Error())
}
return Delimiter{regex: rx}
}