Thursday 29 September 2011

Weird if statement

I found the following if statement a long long time ago.

// determine if c lies between a and b
if (c == a || c == b || (c > a && c < b))
{
    doStuff();
}

Refactor.

No comments:

Post a Comment