MCPcopy Index your code
hub / github.com/coder/coder / SortedKeys

Function SortedKeys

coderd/util/maps/maps.go:34–40  ·  view source on GitHub ↗

SortedKeys returns the keys of m in sorted order.

(m map[K]V)

Source from the content-addressed store, hash-verified

32
33// SortedKeys returns the keys of m in sorted order.
34func SortedKeys[K constraints.Ordered, V any](m map[K]V) (keys []K) {
35 for k := range m {
36 keys = append(keys, k)
37 }
38 sort.Slice(keys, func(i, j int) bool { return keys[i] < keys[j] })
39 return keys
40}

Callers 3

TestSortedKeysFunction · 0.92
updateAuditDocFunction · 0.92
updatePrometheusDocFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestSortedKeysFunction · 0.74