summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-09 20:08:43 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-09 20:08:43 +0000
commita7a108173f21624afffbda4dc2e26bc95ab2d2e7 (patch)
tree728d77994c54a4c1af3d3e0359004e853f64a737
parent31753473a66501cfebfc9c62a432a56d6a4d38eb (diff)
downloadbcm5719-llvm-a7a108173f21624afffbda4dc2e26bc95ab2d2e7.tar.gz
bcm5719-llvm-a7a108173f21624afffbda4dc2e26bc95ab2d2e7.zip
Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.
llvm-svn: 165538
-rw-r--r--clang/lib/AST/ASTContext.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 0d288466b4e..a90f0733496 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<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) {
OpenPOWER on IntegriCloud