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) { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits