From e30b8ca149076601ee593d93a35e39f7e7e219eb Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 3 Jan 2016 19:43:40 +0000 Subject: Use std::is_sorted and std::none_of instead of manual loops. NFC llvm-svn: 256719 --- llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp') diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 3e80bfe..d1484be 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -792,10 +792,8 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) { static void AssertSorted(MemoryDependenceAnalysis::NonLocalDepInfo &Cache, int Count = -1) { if (Count == -1) Count = Cache.size(); - if (Count == 0) return; - - for (unsigned i = 1; i != unsigned(Count); ++i) - assert(!(Cache[i] < Cache[i-1]) && "Cache isn't sorted!"); + assert(std::is_sorted(Cache.begin(), Cache.begin() + Count) && + "Cache isn't sorted!"); } #endif -- cgit v1.1