fix(rpc): less clones in logs filter (#7060)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Alexey Shekhirin
2024-03-10 14:18:48 +00:00
committed by GitHub
parent 84e970414e
commit 494361992d
4 changed files with 21 additions and 21 deletions

View File

@@ -3,7 +3,6 @@ use alloy_primitives::TxHash;
use reth_primitives::{BlockNumHash, ChainInfo, Receipt, U256};
use reth_provider::{BlockReader, ProviderError};
use reth_rpc_types::{FilteredParams, Log};
use reth_rpc_types_compat::log::from_primitive_log;
/// Returns all matching of a block's receipts when the transaction hashes are known.
pub(crate) fn matching_block_logs_with_tx_hashes<'a, I>(
@@ -119,8 +118,8 @@ pub(crate) fn log_matches_filter(
if params.filter.is_some() &&
(!params.filter_block_range(block.number) ||
!params.filter_block_hash(block.hash) ||
!params.filter_address(&from_primitive_log(log.clone())) ||
!params.filter_topics(&from_primitive_log(log.clone())))
!params.filter_address(&log.address) ||
!params.filter_topics(&log.topics))
{
return false
}