Remove some copying (#19691)

This commit is contained in:
sakridge
2021-09-08 19:32:38 +03:00
committed by GitHub
parent 007fb3abe5
commit 3a8c678f62
2 changed files with 6 additions and 10 deletions

View File

@ -2894,7 +2894,7 @@ impl Bank {
fn check_age<'a>(
&self,
txs: impl Iterator<Item = &'a SanitizedTransaction>,
lock_results: Vec<Result<()>>,
lock_results: &[Result<()>],
max_age: usize,
error_counters: &mut ErrorCounters,
) -> Vec<TransactionCheckResult> {
@ -2916,7 +2916,7 @@ impl Bank {
(Err(TransactionError::BlockhashNotFound), None)
}
}
Err(e) => (Err(e), None),
Err(e) => (Err(e.clone()), None),
})
.collect()
}
@ -3018,7 +3018,7 @@ impl Bank {
) -> Vec<TransactionCheckResult> {
let age_results = self.check_age(
sanitized_txs.iter(),
lock_results.to_vec(),
lock_results,
max_age,
&mut error_counters,
);