m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

[perf] evaluateBonus can start from sidx - 1

This commit is contained in:
Junegunn Choi
2016-08-14 11:58:47 +09:00
parent d9c8a9a880
commit 41e916a511
3 changed files with 6 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ func evaluateBonus(caseSensitive bool, text util.Chars, pattern []rune, sidx int
lenPattern := len(pattern)
consecutive := false
prevClass := charNonWord
for index := 0; index < eidx; index++ {
for index := util.Max(0, sidx-1); index < eidx; index++ {
char := text.Get(index)
var class charClass
if unicode.IsLower(char) {