Skip to content

Commit a20c138

Browse files
authored
get rid of intermediate collect (solana-labs#3788)
1 parent 8c14ca5 commit a20c138

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

core/src/banking_stage/transaction_scheduler/scheduler_controller.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,14 @@ impl<C: LikeClusterInfo, R: ReceiveAndBuffer> SchedulerController<C, R> {
220220
&mut error_counters,
221221
);
222222

223-
let fee_check_results: Vec<_> = check_results
223+
for ((check_result, tx), result) in check_results
224224
.into_iter()
225225
.zip(transactions)
226-
.map(|(result, tx)| {
227-
result?; // if there's already error do nothing
228-
Consumer::check_fee_payer_unlocked(bank, *tx, &mut error_counters)
229-
})
230-
.collect();
231-
232-
for (fee_check_result, result) in fee_check_results.into_iter().zip(results.iter_mut()) {
233-
*result = fee_check_result.is_ok();
226+
.zip(results.iter_mut())
227+
{
228+
*result = check_result
229+
.and_then(|_| Consumer::check_fee_payer_unlocked(bank, *tx, &mut error_counters))
230+
.is_ok();
234231
}
235232
}
236233

0 commit comments

Comments
 (0)