From: Argyrios Kyrtzidis Date: Tue, 9 Oct 2012 20:08:43 +0000 (+0000) Subject: Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc0a2bb8dc122f8daae890ec82cecfe2054859eb;p=clang Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165538 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 0d288466b4..a90f073349 100644 --- a/lib/AST/ASTContext.cpp +++ b/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) {