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 e353195 commit abaa824Copy full SHA for abaa824
llvm/lib/ProfileData/MemProfReader.cpp
@@ -193,14 +193,10 @@ CallStackMap readStackInfo(const char *Ptr) {
193
// addresses.
194
bool mergeStackMap(const CallStackMap &From, CallStackMap &To) {
195
for (const auto &[Id, Stack] : From) {
196
- auto I = To.find(Id);
197
- if (I == To.end()) {
198
- To[Id] = Stack;
199
- } else {
200
- // Check that the PCs are the same (in order).
201
- if (Stack != I->second)
202
- return true;
203
- }
+ auto [It, Inserted] = To.try_emplace(Id, Stack);
+ // Check that the PCs are the same (in order).
+ if (!Inserted && Stack != It->second)
+ return true;
204
}
205
return false;
206
0 commit comments