gods/maps/misc.go

11 lines
139 B
Go
Raw Permalink Normal View History

2023-10-28 14:26:50 +03:00
package maps
2023-07-28 20:48:02 +03:00
func Reversed[K, V comparable](m map[K] V) map[V] K {
r := make(map[V] K)
for k, v := range m {
r[v] = k
}
return r
}