Skip to content

Commit

Permalink
get rid of intermediate collect (#3788)
Browse files Browse the repository at this point in the history
  • Loading branch information
bw-solana authored Nov 26, 2024
1 parent 8c14ca5 commit a20c138
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,14 @@ impl<C: LikeClusterInfo, R: ReceiveAndBuffer> SchedulerController<C, R> {
&mut error_counters,
);

let fee_check_results: Vec<_> = check_results
for ((check_result, tx), result) in check_results
.into_iter()
.zip(transactions)
.map(|(result, tx)| {
result?; // if there's already error do nothing
Consumer::check_fee_payer_unlocked(bank, *tx, &mut error_counters)
})
.collect();

for (fee_check_result, result) in fee_check_results.into_iter().zip(results.iter_mut()) {
*result = fee_check_result.is_ok();
.zip(results.iter_mut())
{
*result = check_result
.and_then(|_| Consumer::check_fee_payer_unlocked(bank, *tx, &mut error_counters))
.is_ok();
}
}

Expand Down

0 comments on commit a20c138

Please sign in to comment.