From: Craig Topper Date: Sun, 3 Jan 2016 19:43:20 +0000 (+0000) Subject: Use std::is_sorted instead of a manual loop. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7be35d9e556c737c0e62640ba6476a8be5cf211;p=clang Use std::is_sorted instead of a manual loop. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256717 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 5f3ebbd757..e30b2875f2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -4770,11 +4770,7 @@ llvm::Constant *IvarLayoutBuilder::buildBitmap(CGObjCCommonMac &CGObjC, // This isn't a stable sort, but our algorithm should handle it fine. llvm::array_pod_sort(IvarsInfo.begin(), IvarsInfo.end()); } else { -#ifndef NDEBUG - for (unsigned i = 1; i != IvarsInfo.size(); ++i) { - assert(IvarsInfo[i - 1].Offset <= IvarsInfo[i].Offset); - } -#endif + assert(std::is_sorted(IvarsInfo.begin(), IvarsInfo.end())); } assert(IvarsInfo.back().Offset < InstanceEnd);