Re: Should I do loops in reverse order ?
Re: Should I do loops in reverse order ?
- Subject: Re: Should I do loops in reverse order ?
- From: "Sean McBride" <email@hidden>
- Date: Mon, 27 Nov 2006 12:45:24 -0500
- Organization: Rogue Research
On 2006-11-27 09:22, Matt Neuburg said:
>What I would do is:
>
>int i,u=[myArray count];
>for (i=0; i<u; i++)
Matt,
I know you've just typed this in mail, but remember that -count returns
'unsigned int' not 'int'. :)
I'm not aware of any gcc warning that will catch that mistake (someone
prove me wrong, please!!). CodeWarrior will catch it though, even with
it's out of date Obj-C support: Warning : implicit arithmetic conversion
from 'unsigned int' to 'int'.
The OP made the same error:
int i;
for ( i=0 ; i<[myArray count] ; i++ ) {
// do stuff
}
This gcc will catch if you turn on GCC_WARN_SIGN_COMPARE aka -Wsign-compare.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden