Re: Unnecessary Boolean Warning
Re: Unnecessary Boolean Warning
- Subject: Re: Unnecessary Boolean Warning
- From: "Glenn L. Austin" <email@hidden>
- Date: Sun, 31 Jul 2011 14:10:48 -0700
On Jul 31, 2011, at 1:13 PM, Gordon Apple wrote:
> The following expression generates a warning message (“&&” within “||”) and says to include the “anded” expression in parens. Anybody who understands basic boolean operator precedence knows this is unnecessary. Bug report?
>
> BOOL isInUse = [super mediaIsInUse];
> isInUse = isInUse || [self videoIsOn] && ([[self capMgr] isRecording]
> || [[self camVC] movieIsPlaying]
> || [[self camVC] movieIsPaused]);
I agree that it is unnecessary, but a lot of the warnings that are now provided are unnecessary but promote better and less ambiguous coding practices.
--
Glenn L. Austin, Computer Wizard and Race Car Driver <><
<http://www.austin-soft.com>
_______________________________________________
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