Re: checking for non zero before ... (Was Re: semantics of init)
Re: checking for non zero before ... (Was Re: semantics of init)
- Subject: Re: checking for non zero before ... (Was Re: semantics of init)
- From: email@hidden (Andrew Demkin)
- Date: Tue, 3 Jun 2003 21:17:09 -0700
At 11:22 PM 6/3/03, Andrew Pinski wrote:
>
You do not need to check if _myString are non NULL (zero) before
>
sending it a message except for speed reasons.
>
>
Thanks,
>
Andrew Pinski
>
>
>
On Tuesday, Jun 3, 2003, at 23:13 US/Eastern, Kyle Moffett wrote:
>
>
> - (void) dealloc {
>
> if (_myString) [_myString release];
>
> if (_myId) [_myId release];
>
> }
Of course, if the common case is that the instance variables are non-nil
(as I expect they would be in most cases), the added test doesn't help the
speed at all. The moral to the story -- [myVar release] should be
unconditional.
-- Andrew.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.