]> granicus.if.org Git - clang/commitdiff
Very minor simplification and typo correction; no functional changes intended.
authorAaron Ballman <aaron@aaronballman.com>
Thu, 6 Mar 2014 19:10:16 +0000 (19:10 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 6 Mar 2014 19:10:16 +0000 (19:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203144 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ThreadSafety.cpp

index 33799c4f8875ea79b26dc57dd0b7fb1e999ab860..b19d4a398186fd6bb2d17b9039fa6bdc36a5b506 100644 (file)
@@ -716,27 +716,16 @@ public:
   }
 };
 
-
-
 /// \brief A short list of SExprs
 class MutexIDList : public SmallVector<SExpr, 3> {
 public:
-  /// \brief Return true if the list contains the specified SExpr
-  /// Performs a linear search, because these lists are almost always very small.
-  bool contains(const SExpr& M) {
-    for (iterator I=begin(),E=end(); I != E; ++I)
-      if ((*I) == M) return true;
-    return false;
-  }
-
-  /// \brief Push M onto list, bud discard duplicates
+  /// \brief Push M onto list, but discard duplicates.
   void push_back_nodup(const SExpr& M) {
-    if (!contains(M)) push_back(M);
+    if (end() == std::find(begin(), end(), M))
+      push_back(M);
   }
 };
 
-
-
 /// \brief This is a helper class that stores info about the most recent
 /// accquire of a Lock.
 ///