From 787e0526dced90590fe34690be7cbe4791c4602d Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Fri, 21 Feb 2025 12:28:34 -0500 Subject: [PATCH] chore(pkg): remove unused util --- pkg/util/map.go | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 pkg/util/map.go diff --git a/pkg/util/map.go b/pkg/util/map.go deleted file mode 100644 index ba07f87..0000000 --- a/pkg/util/map.go +++ /dev/null @@ -1,19 +0,0 @@ -package utils - -import "sort" - -type Pair[K comparable, V any] struct { - Key K - Value V -} - -func SortMap[K comparable, V any](m map[K]V, less func(i, j Pair[K, V]) bool) []Pair[K, V] { - pairs := make([]Pair[K, V], 0, len(m)) - for k, v := range m { - pairs = append(pairs, Pair[K, V]{k, v}) - } - sort.Slice(pairs, func(i, j int) bool { - return less(pairs[i], pairs[j]) - }) - return pairs -}