Skip to content

Commit

Permalink
p2p/enr: reduce allocation in Record.encode (ethereum#24034)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evolution404 authored and JacekGlen committed May 26, 2022
1 parent e40a0be commit 39d966f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/enr/enr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 39d966f

Please sign in to comment.