Skip to content

Commit eedff8b

Browse files
[DebugInfo] Simplify code with std::map::operator[] (NFC) (#115591)
1 parent c3c424d commit eedff8b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/include/llvm/DebugInfo/GSYM/OutputAggregator.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@ class OutputAggregator {
6060
// then merge it in here. Note that this is *not* thread safe. It is up to
6161
// the caller to ensure that this is only called from one thread at a time.
6262
void Merge(const OutputAggregator &other) {
63-
for (auto &&[name, count] : other.Aggregation) {
64-
auto [it, inserted] = Aggregation.emplace(name, count);
65-
if (!inserted)
66-
it->second += count;
67-
}
63+
for (auto &&[name, count] : other.Aggregation)
64+
Aggregation[name] += count;
6865
}
6966
};
7067

0 commit comments

Comments
 (0)