Skip to content

Commit 5dbfb49

Browse files
[lldb] Avoid repeated hash lookups (NFC) (llvm#113248)
1 parent 0690a42 commit 5dbfb49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ bool DynamicLoaderFreeBSDKernel::ParseKmods(Address linker_files_head_addr) {
552552
m_process->GetTarget().ModulesDidUnload(remove_modules, false);
553553

554554
for (KModImageInfo &image_info : linker_files_list) {
555-
if (m_kld_name_to_uuid.find(image_info.GetName()) !=
556-
m_kld_name_to_uuid.end())
557-
image_info.SetUUID(m_kld_name_to_uuid[image_info.GetName()]);
555+
auto it = m_kld_name_to_uuid.find(image_info.GetName());
556+
if (it != m_kld_name_to_uuid.end())
557+
image_info.SetUUID(it->second);
558558
bool failed_to_load = false;
559559
if (!image_info.LoadImageUsingMemoryModule(m_process)) {
560560
image_info.LoadImageUsingFileAddress(m_process);

0 commit comments

Comments
 (0)