rlp: using maps.Clone (#29434)
This commit is contained in:
parent
fde90443a4
commit
31e63fcf66
@ -18,6 +18,7 @@ package rlp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
@ -90,10 +91,7 @@ func (c *typeCache) generate(typ reflect.Type, tags rlpstruct.Tags) *typeinfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy cur to next.
|
// Copy cur to next.
|
||||||
c.next = make(map[typekey]*typeinfo, len(cur)+1)
|
c.next = maps.Clone(cur)
|
||||||
for k, v := range cur {
|
|
||||||
c.next[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate.
|
// Generate.
|
||||||
info := c.infoWhileGenerating(typ, tags)
|
info := c.infoWhileGenerating(typ, tags)
|
||||||
|
Loading…
Reference in New Issue
Block a user