From 4e04dbe434cd161d937cf534c3e407cfc32dc89f Mon Sep 17 00:00:00 2001 From: zhangsoledad <787953403@qq.com> Date: Sat, 23 Oct 2021 11:57:17 +0800 Subject: [PATCH] perf: remove needless collect --- verification/contextual/src/contextual_block_verifier.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/verification/contextual/src/contextual_block_verifier.rs b/verification/contextual/src/contextual_block_verifier.rs index 1b112e9e04..3441ca4df7 100644 --- a/verification/contextual/src/contextual_block_verifier.rs +++ b/verification/contextual/src/contextual_block_verifier.rs @@ -182,9 +182,7 @@ impl<'a, CS: ChainStore<'a>> TwoPhaseCommitVerifier<'a, CS> { .map(TransactionView::proposal_short_id) .collect(); - let difference: Vec<_> = committed_ids.difference(&proposal_txs_ids).collect(); - - if !difference.is_empty() { + if committed_ids.difference(&proposal_txs_ids).next().is_some() { error_target!( crate::LOG_TARGET, "BlockView {} {}",