chore(deps): remove direct dependency on golang.org/x/exp

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan
2025-12-31 17:02:52 -05:00
parent fc9817552d
commit 735c0d9103
4 changed files with 12 additions and 11 deletions
+2 -5
View File
@@ -6,9 +6,8 @@ import (
"cmp"
"io"
"iter"
"maps"
"slices"
"golang.org/x/exp/maps"
)
func Map[T any, R any](t []T, mapFunc func(T) R) []R {
@@ -49,11 +48,9 @@ func CompactByFrequency[T comparable](list []T) []T {
counters[item]++
}
sorted := maps.Keys(counters)
slices.SortFunc(sorted, func(i, j T) int {
return slices.SortedFunc(maps.Keys(counters), func(i, j T) int {
return cmp.Compare(counters[j], counters[i])
})
return sorted
}
func MostFrequent[T comparable](list []T) T {