From 34d39287b514e745ebc4b199e44dbdc95a30db2b Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 22 Aug 2012 00:02:08 +0000 Subject: [PATCH] Consilidate SmallPtrSet count() followed by insert() into a single insert(). llvm-svn: 162330 --- clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Core/RegionStore.cpp b/clang/lib/StaticAnalyzer/Core/RegionStore.cpp index bc4e4bbf602b..e34f418e0763 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; }