core/types: reduce allocs in CreateBloom (#35234)

This commit is contained in:
cui 2026-07-02 16:43:42 +08:00 committed by GitHub
parent 0a47739f11
commit b4f749af11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,9 +110,9 @@ func CreateBloom(receipt *Receipt) Bloom {
buf [6]byte buf [6]byte
) )
for _, log := range receipt.Logs { for _, log := range receipt.Logs {
bin.AddWithBuffer(log.Address.Bytes(), &buf) bin.AddWithBuffer(log.Address[:], &buf)
for _, b := range log.Topics { for k := range log.Topics {
bin.AddWithBuffer(b[:], &buf) bin.AddWithBuffer(log.Topics[k][:], &buf)
} }
} }
return bin return bin