Skip to content

Commit bb75a96

Browse files
[Support] Avoid repeated hash lookups (NFC) (#127747)
1 parent 1bb72f0 commit bb75a96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/Support/DebugCounter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ class DebugCounter {
162162
protected:
163163
unsigned addCounter(const std::string &Name, const std::string &Desc) {
164164
unsigned Result = RegisteredCounters.insert(Name);
165-
Counters[Result] = {};
166-
Counters[Result].Desc = Desc;
165+
auto &C = Counters[Result];
166+
C = {};
167+
C.Desc = Desc;
167168
return Result;
168169
}
169170
// Struct to store counter info.

0 commit comments

Comments
 (0)