Debian Codegraph @

internal/engine/wazevo/wazevoapi/resetmap.go

raw
1 package wazevoapi
2
3 // ResetMap resets the map to an empty state, or creates a new map if it is nil.
4 func ResetMap[K comparable, V any](m map[K]V) map[K]V {
5 if m == nil {
6 m = make(map[K]V)
7 } else {
8 clear(m)
9 }
10 return m
11 }