From f35494128e682a3db068303dcd1dbc499aacf86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Wed, 22 Nov 2023 16:05:12 +0100 Subject: [PATCH] Unifies missing entry insertion in LoadedPrograms::extract(). --- program-runtime/src/loaded_programs.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index 607d2a7bb80268..c210b8d0e9b314 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -808,6 +808,7 @@ impl LoadedPrograms { let mut extracting = extracted.lock().unwrap(); extracting.loaded.entries = keys .filter_map(|(key, (match_criteria, count))| { + let mut reloading = false; if let Some(second_level) = self.entries.get(&key) { for entry in second_level.iter().rev() { let is_ancestor = if let Some(fork_graph) = &self.fork_graph { @@ -833,13 +834,12 @@ impl LoadedPrograms { if !Self::is_entry_usable(entry, current_slot, &match_criteria) || !Self::matches_environment(entry, environments) { - extracting.missing.insert(key, (count, false)); - return None; + break; } if let LoadedProgramType::Unloaded(_environment) = &entry.program { - extracting.missing.insert(key, (count, true)); - return None; + reloading = true; + break; } let mut usage_count = @@ -862,7 +862,7 @@ impl LoadedPrograms { } } } - extracting.missing.insert(key, (count, false)); + extracting.missing.insert(key, (count, reloading)); None }) .collect::>>();