Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DebugInfo] Simplify code with std::map::operator[] (NFC) #115591

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading