From 43a9b3443b3d86c3beb1e3e19921474191ed0ab4 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 6 Mar 2014 19:10:16 +0000 Subject: [PATCH] Very minor simplification and typo correction; no functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203144 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/ThreadSafety.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index 33799c4f88..b19d4a3981 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/lib/Analysis/ThreadSafety.cpp @@ -716,27 +716,16 @@ public: } }; - - /// \brief A short list of SExprs class MutexIDList : public SmallVector { 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. /// -- 2.40.0