Skip to content

Commit

Permalink
drain passed to closure
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Oct 3, 2024
1 parent 56d20aa commit 8b6fd3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ fn process_entries(
process_batches(
bank,
replay_tx_thread_pool,
batches.drain(..),
batches,
transaction_status_sender,
replay_vote_sender,
batch_timing,
Expand Down Expand Up @@ -724,7 +724,7 @@ fn queue_batches_with_lock_retry(
transactions: Vec<SanitizedTransaction>,
batches: &mut Vec<LockedTransactionsWithIndexes<SanitizedTransaction>>,
mut process_batches: impl FnMut(
&mut Vec<LockedTransactionsWithIndexes<SanitizedTransaction>>,
std::vec::Drain<LockedTransactionsWithIndexes<SanitizedTransaction>>,
) -> Result<()>,
) -> Result<()> {
// try to lock the accounts
Expand All @@ -749,7 +749,7 @@ fn queue_batches_with_lock_retry(

// Use the callback to process batches, and clear them.
// Clearing the batches will `Drop` the batches which will unlock the accounts.
process_batches(batches)?;
process_batches(batches.drain(..))?;

// Retry the lock
let lock_results = bank.try_lock_accounts(&transactions);
Expand Down

0 comments on commit 8b6fd3f

Please sign in to comment.