diff --git a/store/trace.go b/store/trace.go index b67aec3472..a4d309a8f4 100644 --- a/store/trace.go +++ b/store/trace.go @@ -1,6 +1,6 @@ package store -import "golang.org/x/exp/maps" +import "maps" // TraceContext contains KVStore context data. It will be written with every // trace operation. @@ -17,9 +17,7 @@ func (tc TraceContext) Merge(newTc TraceContext) TraceContext { tc = TraceContext{} } - for k, v := range newTc { - tc[k] = v - } + maps.Copy(tc, newTc) return tc } diff --git a/x/params/types/subspace.go b/x/params/types/subspace.go index baa95ff2a5..69691de8ae 100644 --- a/x/params/types/subspace.go +++ b/x/params/types/subspace.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "maps" "reflect" "cosmossdk.io/store/prefix" @@ -57,9 +58,7 @@ func (s Subspace) WithKeyTable(table KeyTable) Subspace { panic("WithKeyTable() called on already initialized Subspace") } - for k, v := range table.m { - s.table.m[k] = v - } + maps.Copy(s.table.m, table.m) // Allocate additional capacity for Subspace.name // So we don't have to allocate extra space each time appending to the key