Skip to content

Commit 78768c5

Browse files
[clang-move] Avoid repeated hash lookups (NFC) (#109374)
1 parent 69dbf46 commit 78768c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-move/HelperDeclRefGraph.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ HelperDeclRefGraph::getReachableNodes(const Decl *Root) const {
7676
llvm::DenseSet<const CallGraphNode *> ConnectedNodes;
7777
std::function<void(const CallGraphNode *)> VisitNode =
7878
[&](const CallGraphNode *Node) {
79-
if (ConnectedNodes.count(Node))
79+
if (!ConnectedNodes.insert(Node).second)
8080
return;
81-
ConnectedNodes.insert(Node);
8281
for (auto It = Node->begin(), End = Node->end(); It != End; ++It)
8382
VisitNode(*It);
8483
};

0 commit comments

Comments
 (0)