From a7a108173f21624afffbda4dc2e26bc95ab2d2e7 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 9 Oct 2012 20:08:43 +0000 Subject: [PATCH] Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer. llvm-svn: 165538 --- clang/lib/AST/ASTContext.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 0d28846..a90f073 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1031,11 +1031,8 @@ void ASTContext::getOverriddenMethods(const NamedDecl *D, assert(D); if (const CXXMethodDecl *CXXMethod = dyn_cast(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 OverDecls; Method->getOverriddenMethods(OverDecls); - for (SmallVector::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) { -- 2.7.4