[cfe-commits] r162330 - /cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp

Ted Kremenek kremenek at apple.com
Tue Aug 21 17:02:08 PDT 2012


Author: kremenek
Date: Tue Aug 21 19:02:08 2012
New Revision: 162330

URL: http://llvm.org/viewvc/llvm-project?rev=162330&view=rev
Log:
Consilidate SmallPtrSet count() followed by insert() into a single insert().

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=162330&r1=162329&r2=162330&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/RegionStore.cpp Tue Aug 21 19:02:08 2012
@@ -477,12 +477,8 @@
   }
 
   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;
   }





More information about the cfe-commits mailing list