mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-30 02:40:33 +00:00
15 lines
291 B
Go
15 lines
291 B
Go
package utils
|
|
|
|
import "git.sr.ht/~ashkeel/containers/sync"
|
|
|
|
func MergeMap[T comparable, V any](a, b map[T]V) {
|
|
for key, value := range b {
|
|
a[key] = value
|
|
}
|
|
}
|
|
|
|
func MergeSyncMap[T comparable, V any](a, b *sync.Map[T, V]) {
|
|
merged := a.Copy()
|
|
MergeMap(merged, b.Copy())
|
|
a.Set(merged)
|
|
}
|