From ecd154e702aaf7896739c1c2b2b0c796ae872030 Mon Sep 17 00:00:00 2001 From: Wasim Nazir Date: Thu, 6 Apr 2023 15:07:22 +0530 Subject: [PATCH] libmodprobe: LPM: Cleanup of redundant check Removing find-check while removing modules in loop. Test: Normal/Recovery Boot to home Bug: 261678056 Change-Id: I5ff41b3e8cf633dc687f819a146404b863d2ae0a Signed-off-by: Wasim Nazir --- libmodprobe/libmodprobe.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libmodprobe/libmodprobe.cpp b/libmodprobe/libmodprobe.cpp index 4fbb19d1a..6c5ca99b9 100644 --- a/libmodprobe/libmodprobe.cpp +++ b/libmodprobe/libmodprobe.cpp @@ -524,11 +524,8 @@ bool Modprobe::LoadModulesParallel(int num_threads) { std::lock_guard guard(module_loaded_lock_); // Remove loaded module form mod_with_deps and soft dependencies of other modules - for (const auto& module_loaded : module_loaded_) { - if (mod_with_deps.find(module_loaded) != mod_with_deps.end()) { - mod_with_deps.erase(module_loaded); - } - } + for (const auto& module_loaded : module_loaded_) + mod_with_deps.erase(module_loaded); // Remove loaded module form dependencies of other modules which are not loaded yet for (const auto& module_loaded_path : module_loaded_paths_) {