We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3940a1b commit ab95ed5Copy full SHA for ab95ed5
llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
@@ -156,10 +156,8 @@ class ProfiledCallGraph {
156
ProfiledCallGraphEdge Edge(ProfiledFunctions[CallerName],
157
CalleeIt->second, Weight);
158
auto &Edges = ProfiledFunctions[CallerName]->Edges;
159
- auto EdgeIt = Edges.find(Edge);
160
- if (EdgeIt == Edges.end()) {
161
- Edges.insert(Edge);
162
- } else {
+ auto [EdgeIt, Inserted] = Edges.insert(Edge);
+ if (!Inserted) {
163
// Accumulate weight to the existing edge.
164
Edge.Weight += EdgeIt->Weight;
165
Edges.erase(EdgeIt);
0 commit comments