[cfe-commits] r165538 - /cfe/trunk/lib/AST/ASTContext.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Oct 9 13:08:44 PDT 2012


Author: akirtzidis
Date: Tue Oct  9 15:08:43 2012
New Revision: 165538

URL: http://llvm.org/viewvc/llvm-project?rev=165538&view=rev
Log:
Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=165538&r1=165537&r2=165538&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue Oct  9 15:08:43 2012
@@ -1031,11 +1031,8 @@
   assert(D);
 
   if (const CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
-    for (CXXMethodDecl::method_iterator
-              M = CXXMethod->begin_overridden_methods(),
-           MEnd = CXXMethod->end_overridden_methods();
-         M != MEnd; ++M)
-      Overridden.push_back(*M);
+    Overridden.append(CXXMethod->begin_overridden_methods(),
+                      CXXMethod->end_overridden_methods());
     return;
   }
 
@@ -1045,11 +1042,7 @@
 
   SmallVector<const ObjCMethodDecl *, 8> OverDecls;
   Method->getOverriddenMethods(OverDecls);
-  for (SmallVector<const ObjCMethodDecl *, 8>::iterator
-            M = OverDecls.begin(),
-         MEnd = OverDecls.end();
-       M != MEnd; ++M)
-    Overridden.push_back(*M);
+  Overridden.append(OverDecls.begin(), OverDecls.end());
 }
 
 void ASTContext::addedLocalImportDecl(ImportDecl *Import) {





More information about the cfe-commits mailing list