Skip to content

Commit ea24836

Browse files
[IPO] Avoid repeated map lookups (NFC) (#128462)
1 parent 71b7b1f commit ea24836

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/SampleContextTracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ SampleContextTracker::moveContextSamples(ContextTrieNode &ToNodeParent,
7171
std::map<uint64_t, ContextTrieNode> &AllChildContext =
7272
ToNodeParent.getAllChildContext();
7373
assert(!AllChildContext.count(Hash) && "Node to remove must exist");
74-
AllChildContext[Hash] = NodeToMove;
7574
ContextTrieNode &NewNode = AllChildContext[Hash];
75+
NewNode = NodeToMove;
7676
NewNode.setCallSiteLoc(CallSite);
7777

7878
// Walk through nodes in the moved the subtree, and update

0 commit comments

Comments
 (0)