From 19b19592a7d6894e2af316e35053aae8d1756c7d Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Thu, 5 Dec 2024 19:21:51 +0700 Subject: [PATCH] EncodeBranch: no copy (#12993) --- erigon-lib/commitment/commitment.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/erigon-lib/commitment/commitment.go b/erigon-lib/commitment/commitment.go index 3ea27ad1ffe..60ca4bcca6f 100644 --- a/erigon-lib/commitment/commitment.go +++ b/erigon-lib/commitment/commitment.go @@ -348,11 +348,8 @@ func (be *BranchEncoder) EncodeBranch(bitmap, touchMap, afterMap uint16, readCel } bitset ^= bit } - res := make([]byte, be.buf.Len()) - copy(res, be.buf.Bytes()) - //fmt.Printf("EncodeBranch [%x] size: %d\n", be.buf.Bytes(), be.buf.Len()) - return res, lastNibble, nil + return be.buf.Bytes(), lastNibble, nil } func RetrieveCellNoop(nibble int, skip bool) (*cell, error) { return nil, nil }