• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: checking for non zero before ... (Was Re: semantics of init)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: semantics of init
  • Next by Date: "tocoff in load command 7 extends past the end of the file" error
  • Previous by thread: Re: Interface Builder Palettes Collide
  • Next by thread: "tocoff in load command 7 extends past the end of the file" error
  • Index(es):
    • Date
    • Thread