Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Oct 17, 2024

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/112655.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+1-1)
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 3e09c316d74f44..70cbd1c57b895a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -5324,7 +5324,7 @@ std::string ProcessGDBRemote::HarmonizeThreadIdsForProfileData(
         std::map<uint64_t, uint32_t>::iterator iterator =
             m_thread_id_to_used_usec_map.find(thread_id);
         if (iterator != m_thread_id_to_used_usec_map.end()) {
-          prev_used_usec = m_thread_id_to_used_usec_map[thread_id];
+          prev_used_usec = iterator->second;
         }
 
         uint32_t real_used_usec = curr_used_usec - prev_used_usec;

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@felipepiovezan
Copy link
Contributor

Thanks for finding those, there are many places in LLDB doing repeated work like this!

@kazutakahirata kazutakahirata merged commit 9173fd7 into llvm:main Oct 17, 2024
7 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lldb branch October 17, 2024 14:45
@jimingham
Copy link
Collaborator

jimingham commented Oct 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants