mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
rlp: improve SplitListValues allocation efficiency (#33554)
This commit is contained in:
parent
e78be59dc9
commit
ef815c59a2
1 changed files with 6 additions and 1 deletions
|
|
@ -158,7 +158,12 @@ func SplitListValues(b []byte) ([][]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var elements [][]byte
|
||||
n, err := CountValues(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var elements = make([][]byte, 0, n)
|
||||
|
||||
for len(b) > 0 {
|
||||
_, tagsize, size, err := readKind(b)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue