Can this statement ever evaluate to FALSE?
Posted
by BojanG
on Stack Overflow
See other posts from Stack Overflow
or by BojanG
Published on 2010-04-12T21:58:13Z
Indexed on
2010/04/12
22:02 UTC
Read the original article
Hit count: 145
c#
I stumbled upon this while doing a review and the author is not available:
int n = Convert.ToInt32(text);
if (((n > 0) || (n < 0)) || (n == 0))
{
return 1;
}
The code in general looks solid and it's hard for me to believe that the only purpose of this snippet is to confuse reviewers, but I don't see a way for this condition to fail. Am I missing something?
© Stack Overflow or respective owner