MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / MapKeysToSlice

Function MapKeysToSlice

pkg/util/convert/convert.go:35–41  ·  view source on GitHub ↗

MapKeysToSlice given the map, it converts the map keys to a slice.

(m map[K]V)

Source from the content-addressed store, hash-verified

33
34// MapKeysToSlice given the map, it converts the map keys to a slice.
35func MapKeysToSlice[K comparable, V any](m map[K]V) []K {
36 s := make([]K, 0, len(m))
37 for k := range m {
38 s = append(s, k)
39 }
40 return s
41}

Callers 4

produceFrameMethod · 0.92
UniquePidsMethod · 0.92
createFunction · 0.92
TestMapKeysToSliceFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMapKeysToSliceFunction · 0.68