diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-10-10 15:32:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-10-10 15:32:48 +0000 |
commit | ad8e079c61d00116944879f2b9f2df32b021d07b (patch) | |
tree | bdf451fb067df0e28d5b53a8e92109866e52705c /clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp | |
parent | 9b5786960d83d4318e220da05651073146a815c2 (diff) | |
download | bcm5719-llvm-ad8e079c61d00116944879f2b9f2df32b021d07b.tar.gz bcm5719-llvm-ad8e079c61d00116944879f2b9f2df32b021d07b.zip |
Reduce double set lookups. NFC.
llvm-svn: 219504
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index c0bc902c490..010d26e48e1 100644 --- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -365,12 +365,9 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, const ExplodedNode *N = WL1.pop_back_val(); // Have we already visited this node? If so, continue to the next one. - if (Pass1.count(N)) + if (!Pass1.insert(N).second) continue; - // Otherwise, mark this node as visited. - Pass1.insert(N); - // If this is a root enqueue it to the second worklist. if (N->Preds.empty()) { WL2.push_back(N); @@ -378,9 +375,7 @@ ExplodedGraph::trim(ArrayRef<const NodeTy *> Sinks, } // Visit our predecessors and enqueue them. - for (ExplodedNode::pred_iterator I = N->Preds.begin(), E = N->Preds.end(); - I != E; ++I) - WL1.push_back(*I); + WL1.append(N->Preds.begin(), N->Preds.end()); } // We didn't hit a root? Return with a null pointer for the new graph. |