Use cast_or_null instead of ternary operator (suggested by Doug).

llvm-svn: 69975
This commit is contained in:
Steve Naroff 2009-04-24 16:59:10 +00:00
parent 7049e79e45
commit b87eeaeadf
1 changed files with 1 additions and 3 deletions

View File

@ -298,9 +298,7 @@ void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) {
for (unsigned I = 0; I != NumProtoRefs; ++I)
ProtoRefs.push_back(cast<ObjCProtocolDecl>(Reader.GetDecl(Record[Idx++])));
CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, Reader.getContext());
unsigned nextCat = Record[Idx++];
CD->setNextClassCategory(nextCat ?
cast<ObjCCategoryDecl>(Reader.GetDecl(nextCat)) : 0);
CD->setNextClassCategory(cast_or_null<ObjCCategoryDecl>(Reader.GetDecl(Record[Idx++])));
CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
}