summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-07-16 16:21:02 +0000
committerSteve Naroff <snaroff@apple.com>2009-07-16 16:21:02 +0000
commitfac5bc92642690f7418eb9f38348c731dc8488bb (patch)
tree29e7ddbfa4ba5e23e5ccabf958a9ad0d5af4a047 /clang/lib
parent1511f701e7316635868e81753788d1192ac770b3 (diff)
downloadbcm5719-llvm-fac5bc92642690f7418eb9f38348c731dc8488bb.tar.gz
bcm5719-llvm-fac5bc92642690f7418eb9f38348c731dc8488bb.zip
Cleanup a couple loops and improve a comment (based on feedback from Fariborz).
llvm-svn: 76078
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index dd9e9632b24..b43aadb62e4 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3207,8 +3207,10 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT,
// through its super class and categories.
for (ObjCObjectPointerType::qual_iterator J = RHSOPT->qual_begin(),
E = RHSOPT->qual_end(); J != E; ++J) {
- if ((*J)->lookupProtocolNamed((*I)->getIdentifier()))
+ if ((*J)->lookupProtocolNamed((*I)->getIdentifier())) {
RHSImplementsProtocol = true;
+ break;
+ }
}
if (!RHSImplementsProtocol)
return false;
@@ -3252,9 +3254,11 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCInterfaceType *LHS,
// are incompatible.
for (ObjCQualifiedInterfaceType::qual_iterator RHSPI = RHSP->qual_begin(),
RHSPE = RHSP->qual_end();
- !RHSImplementsProtocol && (RHSPI != RHSPE); RHSPI++) {
- if ((*RHSPI)->lookupProtocolNamed((*LHSPI)->getIdentifier()))
+ RHSPI != RHSPE; RHSPI++) {
+ if ((*RHSPI)->lookupProtocolNamed((*LHSPI)->getIdentifier())) {
RHSImplementsProtocol = true;
+ break;
+ }
}
// FIXME: For better diagnostics, consider passing back the protocol name.
if (!RHSImplementsProtocol)
OpenPOWER on IntegriCloud