Skip to content

Commit b36c738

Browse files
authored
beacon/engine: prealloc capacity for map and slice (#29903)
* prealloc capacity for map and slice * revert unnecessary change
1 parent 50405e2 commit b36c738

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beacon/engine/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
209209
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
210210
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
211211
}
212-
var blobHashes []common.Hash
212+
var blobHashes = make([]common.Hash, 0, len(txs))
213213
for _, tx := range txs {
214214
blobHashes = append(blobHashes, tx.BlobHashes()...)
215215
}

0 commit comments

Comments
 (0)