diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-06 19:10:16 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-06 19:10:16 +0000 |
commit | cea2609b5910e779ac251ef0fbd9859aacc0738f (patch) | |
tree | a0e374d5a1ddb53e6c154b933978034faf944d6f /clang/lib/Analysis/ThreadSafety.cpp | |
parent | 4357f645f590ac4c24037f8db3d809bc143db13f (diff) | |
download | bcm5719-llvm-cea2609b5910e779ac251ef0fbd9859aacc0738f.tar.gz bcm5719-llvm-cea2609b5910e779ac251ef0fbd9859aacc0738f.zip |
Very minor simplification and typo correction; no functional changes intended.
llvm-svn: 203144
Diffstat (limited to 'clang/lib/Analysis/ThreadSafety.cpp')
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 33799c4f887..b19d4a39818 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -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. /// |