From fe7970ce46075256eefb799819f977f889fa2ee4 Mon Sep 17 00:00:00 2001 From: steviez Date: Wed, 13 Dec 2023 19:43:02 -0600 Subject: [PATCH] Remove redundant code from Bank::wrap_with_bank_forks_for_tests() (#34448) The same initialization occurs when the Bank is inserted into a new BankForks, so no need to duplicate the logic in this test function --- runtime/src/bank.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 604fa6844f2a83..42c7414be4f129 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -8166,14 +8166,9 @@ impl Bank { #[cfg(feature = "dev-context-only-utils")] impl Bank { pub fn wrap_with_bank_forks_for_tests(self) -> (Arc, Arc>) { - let bank_fork = BankForks::new_rw_arc(self); - let bank_arc = bank_fork.read().unwrap().root_bank(); - bank_arc - .loaded_programs_cache - .write() - .unwrap() - .set_fork_graph(bank_fork.clone()); - (bank_arc, bank_fork) + let bank_forks = BankForks::new_rw_arc(self); + let bank = bank_forks.read().unwrap().root_bank(); + (bank, bank_forks) } pub fn default_for_tests() -> Self {