1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-27 12:32:37 +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:
Stefan Haller 2024-03-14 08:43:44 +01:00
parent 2cf8e7bc5c
commit a82e26d11e

View File

@ -1,7 +1,6 @@
package utils
import (
"sort"
"strings"
"github.com/sahilm/fuzzy"
@ -14,7 +13,6 @@ func FuzzySearch(needle string, haystack []string) []string {
}
matches := fuzzy.Find(needle, haystack)
sort.Sort(matches)
return lo.Map(matches, func(match fuzzy.Match, _ int) string {
return match.Str