From a82e26d11e4c937c8ca2fdef92bb75ae912e7b44 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 14 Mar 2024 08:43:44 +0100 Subject: [PATCH] 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. --- pkg/utils/search.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/utils/search.go b/pkg/utils/search.go index c204506f0..ab780c5dd 100644 --- a/pkg/utils/search.go +++ b/pkg/utils/search.go @@ -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