From 29cfd02f7828d92136fce32e0cb888e9dd9fd2ba Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 5 Oct 2009 22:35:23 +0000 Subject: Tiny tweak: make isNSNull checks ~3x faster --- Frameworks/MCPKit/MCPFoundationKit/MCPNull.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Frameworks/MCPKit/MCPFoundationKit') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPNull.m b/Frameworks/MCPKit/MCPFoundationKit/MCPNull.m index 5d3f4523..76d9cfb1 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPNull.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPNull.m @@ -35,7 +35,9 @@ */ - (BOOL) isNSNull { - return [self isMemberOfClass:[NSNull class]]; + static id NSNullForComparison; + if (!NSNullForComparison) NSNullForComparison = [NSNull null];; + return (self == NSNullForComparison); } @end -- cgit v1.2.3