[Lldb-commits] [lldb] 5dbfb49 - [lldb] Avoid repeated hash lookups (NFC) (#113248)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 22 07:59:47 PDT 2024


Author: Kazu Hirata
Date: 2024-10-22T07:59:41-07:00
New Revision: 5dbfb49490c5f06c9c7843051471956b11ef2abd

URL: https://github.com/llvm/llvm-project/commit/5dbfb49490c5f06c9c7843051471956b11ef2abd
DIFF: https://github.com/llvm/llvm-project/commit/5dbfb49490c5f06c9c7843051471956b11ef2abd.diff

LOG: [lldb] Avoid repeated hash lookups (NFC) (#113248)

Added: 
    

Modified: 
    lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index 7c678faaae7fd5..8391467c375f42 100644
--- a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -552,9 +552,9 @@ bool DynamicLoaderFreeBSDKernel::ParseKmods(Address linker_files_head_addr) {
   m_process->GetTarget().ModulesDidUnload(remove_modules, false);
 
   for (KModImageInfo &image_info : linker_files_list) {
-    if (m_kld_name_to_uuid.find(image_info.GetName()) !=
-        m_kld_name_to_uuid.end())
-      image_info.SetUUID(m_kld_name_to_uuid[image_info.GetName()]);
+    auto it = m_kld_name_to_uuid.find(image_info.GetName());
+    if (it != m_kld_name_to_uuid.end())
+      image_info.SetUUID(it->second);
     bool failed_to_load = false;
     if (!image_info.LoadImageUsingMemoryModule(m_process)) {
       image_info.LoadImageUsingFileAddress(m_process);


        


More information about the lldb-commits mailing list