Fix - Superfluous `if` condition for overwriting `environments` in feature activation code (#33138)

Removes the `if` block around the overwriting of the `environments`.
This commit is contained in:
Alexander Meißner 2023-09-05 15:01:20 +02:00 committed by GitHub
parent 9ab5c34543
commit e9542200e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 12 deletions

View File

@ -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() {