Re: New warning in Xcode 7
Re: New warning in Xcode 7
- Subject: Re: New warning in Xcode 7
- From: Graham Cox <email@hidden>
- Date: Wed, 14 Oct 2015 10:06:03 +1100
> On 14 Oct 2015, at 9:50 am, Greg Parker <email@hidden> wrote:
>
> You can avoid confusion (human and compiler) by writing the statement without the preincrement's side effect:
> ix = (ix+1) % guess.count;
>
OK, makes sense.
I think my use of the preincrement followed by mod stems from years-old habits of writing embedded software, where ++<var> would typically compile to a single instruction on the 8051 or similar where every clock cycle counted (and <var>=<var>+1 would not). I guess these days it’s a moot point :)
—Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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