diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-13 21:22:14 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-13 21:39:42 -0600 |
commit | 72a458520fccafe4df8c02c811cb6f64a310616e (patch) | |
tree | 1c424b5376c31524b01f8461b02950eb04d48345 /lib/util/maputil.go | |
parent | 952b677bf7f10da93673e3671f764c54c454bbfe (diff) |
Move the remaining former-generic.go parts out of lib/util/
Diffstat (limited to 'lib/util/maputil.go')
-rw-r--r-- | lib/util/maputil.go | 23 |
1 files changed, 0 insertions, 23 deletions
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 <lukeshu@lukeshu.com> -// -// 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 -} |