[cfe-commits] r69975 - /cfe/trunk/lib/Frontend/PCHReader.cpp

Steve Naroff snaroff at apple.com
Fri Apr 24 09:59:13 PDT 2009


Author: snaroff
Date: Fri Apr 24 11:59:10 2009
New Revision: 69975

URL: http://llvm.org/viewvc/llvm-project?rev=69975&view=rev
Log:
Use cast_or_null instead of ternary operator (suggested by Doug).

Modified:
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=69975&r1=69974&r2=69975&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Fri Apr 24 11:59:10 2009
@@ -298,9 +298,7 @@
   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++]));
 }
 





More information about the cfe-commits mailing list