mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Don't sort the results of fuzzy.Find
It sorts them already, so it's unnecessary. In the next commit we use this same code for substring searching too, and in that case we don't want to sort because sorting is by Score, but we don't even fill in the score for substring searching.
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sort"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sahilm/fuzzy"
|
"github.com/sahilm/fuzzy"
|
||||||
@ -14,7 +13,6 @@ func FuzzySearch(needle string, haystack []string) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
matches := fuzzy.Find(needle, haystack)
|
matches := fuzzy.Find(needle, haystack)
|
||||||
sort.Sort(matches)
|
|
||||||
|
|
||||||
return lo.Map(matches, func(match fuzzy.Match, _ int) string {
|
return lo.Map(matches, func(match fuzzy.Match, _ int) string {
|
||||||
return match.Str
|
return match.Str
|
||||||
|
Reference in New Issue
Block a user