From c6914d068f317f3c8bc9734b6bbeb090975b50b1 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 25 Aug 2014 04:15:02 +0000 Subject: Use range based for loops to avoid needing to re-mention SmallPtrSet size. llvm-svn: 216370 --- clang/lib/AST/ASTContext.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 3a150968155..718719a904f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6673,11 +6673,9 @@ void getIntersectionOfProtocols(ASTContext &Context, llvm::SmallPtrSet RHSInheritedProtocols; Context.CollectInheritedProtocols(RHS->getInterface(), RHSInheritedProtocols); - for (llvm::SmallPtrSet::iterator I = - RHSInheritedProtocols.begin(), - E = RHSInheritedProtocols.end(); I != E; ++I) - if (InheritedProtocolSet.count((*I))) - IntersectionOfProtocols.push_back((*I)); + for (ObjCProtocolDecl *ProtDecl : RHSInheritedProtocols) + if (InheritedProtocolSet.count(ProtDecl)) + IntersectionOfProtocols.push_back(ProtDecl); } } -- cgit v1.2.3