aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/RegionStore.cpp
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
commitab9c04fda542d096c667d6a3746d94c884f80e7b (patch)
treee7b2f6f506a73f52051b03fdeff9715523c21b92 /lib/StaticAnalyzer/Core/RegionStore.cpp
parent98ac608c79fb46e73715121018f0659fb3bbe3e8 (diff)
Consilidate SmallPtrSet count() followed by insert() into a single insert().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162330 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp
index bc4e4bbf60..e34f418e07 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/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;
}