Skip to content

Commit

Permalink
[Support] Avoid repeated hash lookups (NFC) (#127747)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Feb 19, 2025
1 parent 1bb72f0 commit bb75a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/include/llvm/Support/DebugCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ class DebugCounter {
protected:
unsigned addCounter(const std::string &Name, const std::string &Desc) {
unsigned Result = RegisteredCounters.insert(Name);
Counters[Result] = {};
Counters[Result].Desc = Desc;
auto &C = Counters[Result];
C = {};
C.Desc = Desc;
return Result;
}
// Struct to store counter info.
Expand Down

0 comments on commit bb75a96

Please sign in to comment.