core/types: opt or using bitutil

This commit is contained in:
cuiweixie 2025-10-11 23:58:49 +08:00
parent 659342a523
commit 115db0d771
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common/bitutil"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
) )
@ -125,9 +126,7 @@ func MergeBloom(receipts Receipts) Bloom {
for _, receipt := range receipts { for _, receipt := range receipts {
if len(receipt.Logs) != 0 { if len(receipt.Logs) != 0 {
bl := receipt.Bloom.Bytes() bl := receipt.Bloom.Bytes()
for i := range bin { bitutil.ORBytes(bin[:], bin[:], bl)
bin[i] |= bl[i]
}
} }
} }
return bin return bin