rlp: improve SplitListValues allocation efficiency (#33554)
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run

This commit is contained in:
maskpp 2026-01-18 16:07:28 +08:00 committed by GitHub
parent e78be59dc9
commit ef815c59a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {