From 72a458520fccafe4df8c02c811cb6f64a310616e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 13 Jul 2022 21:22:14 -0600 Subject: Move the remaining former-generic.go parts out of lib/util/ --- lib/util/maputil.go | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 lib/util/maputil.go (limited to 'lib/util/maputil.go') diff --git a/lib/util/maputil.go b/lib/util/maputil.go deleted file mode 100644 index d7f1727..0000000 --- a/lib/util/maputil.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2022 Luke Shumaker -// -// SPDX-License-Identifier: GPL-2.0-or-later - -package util - -import ( - "golang.org/x/exp/constraints" -) - -func MapKeys[K comparable, V any](m map[K]V) []K { - ret := make([]K, 0, len(m)) - for k := range m { - ret = append(ret, k) - } - return ret -} - -func SortedMapKeys[K constraints.Ordered, V any](m map[K]V) []K { - ret := MapKeys(m) - SortSlice(ret) - return ret -} -- cgit v1.2.3-2-g168b