]> granicus.if.org Git - clang/commitdiff
Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 9 Oct 2012 20:08:43 +0000 (20:08 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 9 Oct 2012 20:08:43 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165538 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 0d288466b4e2ce3905897be58cc4efbd53e59644..a90f0733496d41e77867734fc62607efb73894d1 100644 (file)
@@ -1031,11 +1031,8 @@ void ASTContext::getOverriddenMethods(const NamedDecl *D,
   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 @@ void ASTContext::getOverriddenMethods(const NamedDecl *D,
 
   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) {