rlp: using maps.Clone (#29434)

pull/29439/head
cui 6 months ago committed by GitHub
parent fde90443a4
commit 31e63fcf66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      rlp/typecache.go

@ -18,6 +18,7 @@ package rlp
import (
"fmt"
"maps"
"reflect"
"sync"
"sync/atomic"
@ -90,10 +91,7 @@ func (c *typeCache) generate(typ reflect.Type, tags rlpstruct.Tags) *typeinfo {
}
// Copy cur to next.
c.next = make(map[typekey]*typeinfo, len(cur)+1)
for k, v := range cur {
c.next[k] = v
}
c.next = maps.Clone(cur)
// Generate.
info := c.infoWhileGenerating(typ, tags)

Loading…
Cancel
Save