From 7d5ee793b998434f1f9524efab58363cce1f16dc Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Wed, 20 Jan 2010 04:30:37 +0000 Subject: [Author: dmaclach] Tighten up the type casting code a bit so it looks nicer. R=thomasvl DELTA=8 (0 added, 6 deleted, 2 changed) --- DebugUtils/GTMTypeCasting.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'DebugUtils') diff --git a/DebugUtils/GTMTypeCasting.h b/DebugUtils/GTMTypeCasting.h index 1e9ebb9..6b3d2ef 100644 --- a/DebugUtils/GTMTypeCasting.h +++ b/DebugUtils/GTMTypeCasting.h @@ -47,14 +47,8 @@ extern "C" { // Support functions for dealing with casting. GTM_INLINE id GTMDynamicCastSupport(Class cls, id object) { - id value = nil; - if (object) { - _GTMDevAssert(cls, @"Nil Class"); - if ([object isKindOfClass:cls]) { - value = object; - } - } - return value; + _GTMDevAssert(cls, @"Nil Class"); + return [object isKindOfClass:cls] ? object : nil; } GTM_INLINE id GTMStaticCastSupport(Class cls, id object) { -- cgit v1.2.3