beacon/engine: prealloc capacity for map and slice (#29903)

* prealloc capacity for map and slice

* revert unnecessary change
This commit is contained in:
maskpp 2024-06-03 19:38:08 +07:00 committed by GitHub
parent 50405e29b7
commit b36c73813c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -209,7 +209,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
}
var blobHashes []common.Hash
var blobHashes = make([]common.Hash, 0, len(txs))
for _, tx := range txs {
blobHashes = append(blobHashes, tx.BlobHashes()...)
}