From ef60b2c4ed67017a46442903c898bc24ed9a6c91 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 12 Jan 2007 22:51:20 +0000 Subject: [PATCH] simplify some code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33150 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 0643e75ab34..5ef886e956c 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -533,14 +533,8 @@ void IndVarSimplify::runOnLoop(Loop *L) { InsertedSizes.push_back(LargestType->getPrimitiveSizeInBits()); for (unsigned i = 0, e = IndVars.size(); i != e; ++i) { unsigned ithSize = IndVars[i].first->getType()->getPrimitiveSizeInBits(); - bool alreadyInsertedSize = false; - for (SmallVector::iterator I = InsertedSizes.begin(), - E = InsertedSizes.end(); I != E; ++I) - if (*I == ithSize) { - alreadyInsertedSize = true; - break; - } - if (!alreadyInsertedSize) { + if (std::find(InsertedSizes.begin(), InsertedSizes.end(), ithSize) + == InsertedSizes.end()) { PHINode *PN = IndVars[i].first; InsertedSizes.push_back(ithSize); Instruction *New = new TruncInst(IndVar, PN->getType(), "indvar",