summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-08-22 00:02:08 +0000
committerTed Kremenek <kremenek@apple.com>2012-08-22 00:02:08 +0000
commit34d39287b514e745ebc4b199e44dbdc95a30db2b (patch)
tree05ed4e2d1177f6b0f8f85e8cdb5cbb0503f86aaf
parent7fb0cd26f73f6230571d56e893480f0d3214481c (diff)
downloadbcm5719-llvm-34d39287b514e745ebc4b199e44dbdc95a30db2b.tar.gz
bcm5719-llvm-34d39287b514e745ebc4b199e44dbdc95a30db2b.zip
Consilidate SmallPtrSet count() followed by insert() into a single insert().
llvm-svn: 162330
-rw-r--r--clang/lib/StaticAnalyzer/Core/RegionStore.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
index bc4e4bbf602..e34f418e076 100644
--- a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -477,12 +477,8 @@ public:
}
bool AddToWorkList(const MemRegion *R, const ClusterBindings *C) {
- if (C) {
- if (Visited.count(C))
- return false;
- Visited.insert(C);
- }
-
+ if (C && !Visited.insert(C))
+ return false;
WL.push_back(R);
return true;
}
OpenPOWER on IntegriCloud