r335571 - Modernize a function, NFC.

Vedant Kumar via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 19:50:02 PDT 2018


Author: vedantk
Date: Mon Jun 25 19:50:01 2018
New Revision: 335571

URL: http://llvm.org/viewvc/llvm-project?rev=335571&view=rev
Log:
Modernize a function, NFC.

Modified:
    cfe/trunk/lib/Sema/SemaLambda.cpp

Modified: cfe/trunk/lib/Sema/SemaLambda.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=335571&r1=335570&r2=335571&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLambda.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLambda.cpp Mon Jun 25 19:50:01 2018
@@ -692,9 +692,7 @@ void Sema::deduceClosureReturnType(Captu
   }
 
   // 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(Captu
   // 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 =




More information about the cfe-commits mailing list