Skip to content

Commit

Permalink
[lldb] Avoid repeated hash lookups (NFC) (#112471)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Oct 16, 2024
1 parent b8882be commit 282ab2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lldb/source/Core/Progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 282ab2f

Please sign in to comment.