Skip to content

Commit da06b66

Browse files
phrwlkzerosnacks
andauthored
chore: remove redundant clones in block construction and bloom building (#12383)
Co-authored-by: zerosnacks <[email protected]>
1 parent 63010f4 commit da06b66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/anvil/src/eth/backend/executor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<DB: Db + ?Sized, V: TransactionValidator> TransactionExecutor<'_, DB, V> {
210210
let receipt = tx.create_receipt(&mut cumulative_gas_used);
211211

212212
let ExecutedTransaction { transaction, logs, out, traces, exit_reason: exit, .. } = tx;
213-
build_logs_bloom(logs.clone(), &mut bloom);
213+
build_logs_bloom(&logs, &mut bloom);
214214

215215
let contract_address = out.as_ref().and_then(|out| {
216216
if let Output::Create(_, contract_address) = out {
@@ -264,7 +264,7 @@ impl<DB: Db + ?Sized, V: TransactionValidator> TransactionExecutor<'_, DB, V> {
264264
requests_hash: is_prague.then_some(EMPTY_REQUESTS_HASH),
265265
};
266266

267-
let block = Block::new(partial_header, transactions.clone());
267+
let block = Block::new(partial_header, transactions);
268268
let block = BlockInfo { block, transactions: transaction_infos, receipts };
269269
ExecutedTransactions { block, included, invalid }
270270
}
@@ -451,7 +451,7 @@ impl<DB: Db + ?Sized, V: TransactionValidator> Iterator for &mut TransactionExec
451451
}
452452

453453
/// Inserts all logs into the bloom
454-
fn build_logs_bloom(logs: Vec<Log>, bloom: &mut Bloom) {
454+
fn build_logs_bloom(logs: &[Log], bloom: &mut Bloom) {
455455
for log in logs {
456456
bloom.accrue(BloomInput::Raw(&log.address[..]));
457457
for topic in log.topics() {

0 commit comments

Comments
 (0)