Skip to content

Commit

Permalink
[DebugInfo] Simplify code with std::map::operator[] (NFC) (llvm#115591)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored and Groverkss committed Nov 15, 2024
1 parent 85a9f56 commit 490f9ab
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions llvm/include/llvm/DebugInfo/GSYM/OutputAggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ class OutputAggregator {
// then merge it in here. Note that this is *not* thread safe. It is up to
// the caller to ensure that this is only called from one thread at a time.
void Merge(const OutputAggregator &other) {
for (auto &&[name, count] : other.Aggregation) {
auto [it, inserted] = Aggregation.emplace(name, count);
if (!inserted)
it->second += count;
}
for (auto &&[name, count] : other.Aggregation)
Aggregation[name] += count;
}
};

Expand Down

0 comments on commit 490f9ab

Please sign in to comment.