Skip to content

Commit 4d79e98

Browse files
[Support] Avoid repeated hash lookups (NFC) (llvm#130891)
Co-authored-by: Nikita Popov <[email protected]>
1 parent aa008e0 commit 4d79e98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Support/DebugCounter.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ void DebugCounter::print(raw_ostream &OS) const {
208208
OS << "Counters and values:\n";
209209
for (auto &CounterName : CounterNames) {
210210
unsigned CounterID = getCounterId(std::string(CounterName));
211-
OS << left_justify(RegisteredCounters[CounterID], 32) << ": {"
212-
<< Us.Counters[CounterID].Count << ",";
213-
printChunks(OS, Us.Counters[CounterID].Chunks);
211+
const CounterInfo &C = Us.Counters[CounterID];
212+
OS << left_justify(RegisteredCounters[CounterID], 32) << ": {" << C.Count
213+
<< ",";
214+
printChunks(OS, C.Chunks);
214215
OS << "}\n";
215216
}
216217
}

0 commit comments

Comments
 (0)