From 0e974309d197fcc1ee6829c0b2a7d7b267c20152 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Tue, 26 Jun 2018 02:50:01 +0000 Subject: [PATCH] Modernize a function, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335571 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaLambda.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index fec0d575e5..b6ea484cea 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -692,9 +692,7 @@ void Sema::deduceClosureReturnType(CapturingScopeInfo &CSI) { } // Third case: only one return statement. Don't bother doing extra work! - SmallVectorImpl::iterator I = CSI.Returns.begin(), - E = CSI.Returns.end(); - if (I+1 == E) + if (CSI.Returns.size() == 1) return; // General case: many return statements. @@ -703,8 +701,7 @@ void Sema::deduceClosureReturnType(CapturingScopeInfo &CSI) { // We require the return types to strictly match here. // Note that we've already done the required promotions as part of // processing the return statement. - for (; I != E; ++I) { - const ReturnStmt *RS = *I; + for (const ReturnStmt *RS : CSI.Returns) { const Expr *RetE = RS->getRetValue(); QualType ReturnType = -- 2.40.0