Skip to content

Commit

Permalink
p2p/enr: reduce allocation in Record.encode (#24034) (#561)
Browse files Browse the repository at this point in the history
commit ethereum/go-ethereum@8fbe0b9.

Co-authored-by: Evolution404 <[email protected]>
  • Loading branch information
huyngopt1994 and Evolution404 authored Sep 9, 2024
1 parent 6ada4c9 commit fd7a298
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 fd7a298

Please sign in to comment.