From e9542200e81840001bd38cb122a7ff313aaf5d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Tue, 5 Sep 2023 15:01:20 +0200 Subject: [PATCH] Fix - Superfluous `if` condition for overwriting `environments` in feature activation code (#33138) Removes the `if` block around the overwriting of the `environments`. --- runtime/src/bank.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 22e33a3f55..5a6f2923b4 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -8086,23 +8086,15 @@ impl Bank { ) .unwrap(); let mut loaded_programs_cache = self.loaded_programs_cache.write().unwrap(); - if *loaded_programs_cache.environments.program_runtime_v1 - != program_runtime_environment_v1 - { - loaded_programs_cache.environments.program_runtime_v1 = - Arc::new(program_runtime_environment_v1); - } + loaded_programs_cache.environments.program_runtime_v1 = + Arc::new(program_runtime_environment_v1); let program_runtime_environment_v2 = solana_loader_v4_program::create_program_runtime_environment_v2( &self.runtime_config.compute_budget.unwrap_or_default(), false, /* debugging_features */ ); - if *loaded_programs_cache.environments.program_runtime_v2 - != program_runtime_environment_v2 - { - loaded_programs_cache.environments.program_runtime_v2 = - Arc::new(program_runtime_environment_v2); - } + loaded_programs_cache.environments.program_runtime_v2 = + Arc::new(program_runtime_environment_v2); loaded_programs_cache.prune_feature_set_transition(); } for builtin in BUILTINS.iter() {