]> granicus.if.org Git - clang/commitdiff
Modernize a function, NFC.
authorVedant Kumar <vsk@apple.com>
Tue, 26 Jun 2018 02:50:01 +0000 (02:50 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 26 Jun 2018 02:50:01 +0000 (02:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335571 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLambda.cpp

index fec0d575e5b8ffd9a2b4ab25c820e59c66c1af94..b6ea484cea65d358fca29b7ea56eb1de147dca1b 100644 (file)
@@ -692,9 +692,7 @@ void Sema::deduceClosureReturnType(CapturingScopeInfo &CSI) {
   }
 
   // Third case: only one return statement. Don't bother doing extra work!
-  SmallVectorImpl<ReturnStmt*>::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 =