Re: Adding NSLog() changes behavior
Re: Adding NSLog() changes behavior
- Subject: Re: Adding NSLog() changes behavior
- From: Wade Tregaskis <email@hidden>
- Date: Wed, 17 Mar 2004 09:29:27 +1100
Why all that? Why not just:
- (void)setImage:(NSImage*)newImage {
if ( image ) [image autorelease];
image = [newImage retain];
// Do stuff
}
Because now you've added the overhead of placing the object in an
autorelease pool, which must involve at least some sort of list
operation (probably using CFArray). It's better to add an extra line
and not incur that overhead. It may be picking at straws, certainly,
but ObjC is 'slow' enough without people getting lazy about typing an
extra line. :)
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.