From ea8e85d925c29a5a2fbae7739d30f9e1ac9602cc Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 9 Jun 2015 20:41:21 +0000 Subject: [PATCH] Replace loop with std::equal. NFC intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239430 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/PHITransAddr.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/Analysis/PHITransAddr.cpp b/lib/Analysis/PHITransAddr.cpp index 633d6aaad35..339f7004af8 100644 --- a/lib/Analysis/PHITransAddr.cpp +++ b/lib/Analysis/PHITransAddr.cpp @@ -244,13 +244,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB, GEPI->getNumOperands() == GEPOps.size() && GEPI->getParent()->getParent() == CurBB->getParent() && (!DT || DT->dominates(GEPI->getParent(), PredBB))) { - bool Mismatch = false; - for (unsigned i = 0, e = GEPOps.size(); i != e; ++i) - if (GEPI->getOperand(i) != GEPOps[i]) { - Mismatch = true; - break; - } - if (!Mismatch) + if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) return GEPI; } } -- 2.34.1