Skip to content

Commit 4374dd7

Browse files
AZero13DTeachs
authored andcommitted
Remove unneeded check in CFRelease and CFRetain.
If they were NULL, the program would just exit so this check is not needed
1 parent 2254a13 commit 4374dd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CoreFoundation/Base.subproj/CFRuntime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ CFTypeRef _CFNonObjCRetain(CFTypeRef cf) {
771771

772772
CFTypeRef CFRetain(CFTypeRef cf) {
773773
if (NULL == cf) { CRSetCrashLogMessage("*** CFRetain() called with NULL ***"); HALT; }
774-
if (cf) __CFGenericAssertIsCF(cf);
774+
__CFGenericAssertIsCF(cf);
775775
return _CFRetain(cf, false);
776776
}
777777

@@ -789,7 +789,7 @@ void _CFNonObjCRelease(CFTypeRef cf) {
789789

790790
void CFRelease(CFTypeRef cf) {
791791
if (NULL == cf) { CRSetCrashLogMessage("*** CFRelease() called with NULL ***"); HALT; }
792-
if (cf) __CFGenericAssertIsCF(cf);
792+
__CFGenericAssertIsCF(cf);
793793
_CFRelease(cf);
794794
}
795795

0 commit comments

Comments
 (0)