Unverified Commit 8fbe0b9b authored by Evolution404's avatar Evolution404 Committed by GitHub

p2p/enr: reduce allocation in Record.encode (#24034)

parent 721c5723
......@@ -304,7 +304,7 @@ func (r *Record) AppendElements(list []interface{}) []interface{} {
}
func (r *Record) encode(sig []byte) (raw []byte, err error) {
list := make([]interface{}, 1, 2*len(r.pairs)+1)
list := make([]interface{}, 1, 2*len(r.pairs)+2)
list[0] = sig
list = r.AppendElements(list)
if raw, err = rlp.EncodeToBytes(list); err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment