From c0cd375c0c5b1817db1575c0fd039bae191d01ba Mon Sep 17 00:00:00 2001 From: aarshkshah1992 Date: Wed, 10 Jul 2024 09:57:57 +0400 Subject: [PATCH] get rid of all vars --- chain/types/ethtypes/eth_types.go | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/chain/types/ethtypes/eth_types.go b/chain/types/ethtypes/eth_types.go index 892620dcaaf..29fe5d9e3e6 100644 --- a/chain/types/ethtypes/eth_types.go +++ b/chain/types/ethtypes/eth_types.go @@ -188,8 +188,6 @@ type EthBlock struct { const EthBloomSize = 2048 var ( - EmptyEthBloom = [EthBloomSize / 8]byte{} - FullEthBloom = [EthBloomSize / 8]byte{} EmptyEthHash = EthHash{} EmptyUncleHash = must.One(ParseEthHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")) // Keccak-256 of an RLP of an empty array EmptyRootHash = must.One(ParseEthHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")) // Keccak-256 hash of the RLP of null @@ -197,22 +195,17 @@ var ( EmptyEthNonce = [8]byte{0, 0, 0, 0, 0, 0, 0, 0} ) -func init() { - for i := range FullEthBloom { - FullEthBloom[i] = 0xff - } -} - func NewEmptyEthBloom() []byte { - b := make([]byte, len(EmptyEthBloom)) - copy(b, EmptyEthBloom[:]) - return b + eb := [EthBloomSize / 8]byte{} + return eb[:] } func NewFullEthBloom() []byte { - b := make([]byte, len(FullEthBloom)) - copy(b, FullEthBloom[:]) - return b + fb := [EthBloomSize / 8]byte{} + for i := range fb { + fb[i] = 0xff + } + return fb[:] } func NewEthBlock(hasTransactions bool, tipsetLen int) EthBlock {