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 fec04f2 commit 9a59145Copy full SHA for 9a59145
llvm/lib/Analysis/MemoryProfileInfo.cpp
@@ -164,8 +164,8 @@ void CallStackTrie::addCallStack(
164
}
165
// Update existing caller node if it exists.
166
CallStackTrieNode *Prev = nullptr;
167
- auto Next = Curr->Callers.find(StackId);
168
- if (Next != Curr->Callers.end()) {
+ auto [Next, Inserted] = Curr->Callers.try_emplace(StackId);
+ if (!Inserted) {
169
Prev = Curr;
170
Curr = Next->second;
171
Curr->addAllocType(AllocType);
@@ -177,7 +177,7 @@ void CallStackTrie::addCallStack(
177
178
// Otherwise add a new caller node.
179
auto *New = new CallStackTrieNode(AllocType);
180
- Curr->Callers[StackId] = New;
+ Next->second = New;
181
Curr = New;
182
183
assert(Curr);
0 commit comments