[Lldb-commits] [lldb] 282ab2f - [lldb] Avoid repeated hash lookups (NFC) (#112471)

via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 15 23:11:33 PDT 2024


Author: Kazu Hirata
Date: 2024-10-15T23:11:30-07:00
New Revision: 282ab2f1895450707c9f8fc6a46634620165d1c9

URL: https://github.com/llvm/llvm-project/commit/282ab2f1895450707c9f8fc6a46634620165d1c9
DIFF: https://github.com/llvm/llvm-project/commit/282ab2f1895450707c9f8fc6a46634620165d1c9.diff

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

Added: 
    

Modified: 
    lldb/source/Core/Progress.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/Progress.cpp b/lldb/source/Core/Progress.cpp
index 27774ce7a5521b..c9a556472c06b6 100644
--- a/lldb/source/Core/Progress.cpp
+++ b/lldb/source/Core/Progress.cpp
@@ -151,10 +151,11 @@ void ProgressManager::Decrement(const Progress::ProgressData &progress_data) {
   std::lock_guard<std::mutex> lock(m_entries_mutex);
   llvm::StringRef key = progress_data.title;
 
-  if (!m_entries.contains(key))
+  auto it = m_entries.find(key);
+  if (it == m_entries.end())
     return;
 
-  Entry &entry = m_entries[key];
+  Entry &entry = it->second;
   entry.refcount--;
 
   if (entry.refcount == 0) {


        


More information about the lldb-commits mailing list