mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
fnv
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package generics
|
||||
|
||||
import "sync"
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
var _ Map[string, string] = &RWLockMap[string, string]{}
|
||||
|
||||
@ -41,10 +45,7 @@ func (m *RWLockMap[K, V]) ForEach(f func(K, V)) {
|
||||
}
|
||||
|
||||
func (m *RWLockMap[K, V]) Clone() Map[K, V] {
|
||||
new := make(map[K]V, m.Count())
|
||||
for k, v := range m.m {
|
||||
new[k] = v
|
||||
}
|
||||
new := maps.Clone(m.m)
|
||||
|
||||
return &RWLockMap[K, V]{
|
||||
m: new,
|
||||
|
Reference in New Issue
Block a user