Skip to content

Commit

Permalink
SVM: minor refactoring to improve code readability (solana-labs#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmakarov authored and willhickey committed Mar 20, 2024
1 parent 170df83 commit e2c1cbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions svm/src/transaction_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,11 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
fn filter_executable_program_accounts<'a, CB: TransactionProcessingCallback>(
callbacks: &CB,
txs: &[SanitizedTransaction],
lock_results: &mut [TransactionCheckResult],
check_results: &mut [TransactionCheckResult],
program_owners: &'a [Pubkey],
) -> HashMap<Pubkey, (&'a Pubkey, u64)> {
let mut result: HashMap<Pubkey, (&'a Pubkey, u64)> = HashMap::new();
lock_results.iter_mut().zip(txs).for_each(|etx| {
check_results.iter_mut().zip(txs).for_each(|etx| {
if let ((Ok(()), _nonce, lamports_per_signature), tx) = etx {
if lamports_per_signature.is_some() {
tx.message()
Expand All @@ -361,9 +361,9 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
if let Some(index) =
callbacks.account_matches_owners(key, program_owners)
{
program_owners
.get(index)
.map(|owner| entry.insert((owner, 1)));
if let Some(owner) = program_owners.get(index) {
entry.insert((owner, 1));
}
}
}
});
Expand Down

0 comments on commit e2c1cbf

Please sign in to comment.