Skip to content

Commit 35bbfbc

Browse files
[XRay] Simplify code with DenseMap::operator[] (NFC) (#111786)
1 parent 670a461 commit 35bbfbc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/lib/XRay/BlockIndexer.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,9 @@ Error BlockIndexer::visit(FunctionRecord &R) {
8080
}
8181

8282
Error BlockIndexer::flush() {
83-
Index::iterator It;
84-
std::tie(It, std::ignore) =
85-
Indices.insert({{CurrentBlock.ProcessID, CurrentBlock.ThreadID}, {}});
86-
It->second.push_back({CurrentBlock.ProcessID, CurrentBlock.ThreadID,
87-
CurrentBlock.WallclockTime,
88-
std::move(CurrentBlock.Records)});
83+
Indices[{CurrentBlock.ProcessID, CurrentBlock.ThreadID}].push_back(
84+
{CurrentBlock.ProcessID, CurrentBlock.ThreadID,
85+
CurrentBlock.WallclockTime, std::move(CurrentBlock.Records)});
8986
CurrentBlock.ProcessID = 0;
9087
CurrentBlock.ThreadID = 0;
9188
CurrentBlock.Records = {};

0 commit comments

Comments
 (0)