Resharper (or is it Visual Studio - it's a yellow light bulb with a tiny red filament in it) offers to "invert if" on this code:
if (tItems >= 0)
{
return tItems;
}
SetTotalItemsAndTotalAmt();
...and if I allow it to, it becomes this:
if (tItems < 0)
{
SetTotalItemsAndTotalAmt();
}
return tItems;
...but then it offers to "invert if" again, and if I gullibly take the bait, it sets it back to its former glory.
If one way is considered better (more grokkable, I guess) than the other, why would it also allow a reverse inversion? And if it's a case of "six of one and half a dozen of the other," why does it even bother to offer a change?
UPDATE
Actually, come to think of it, one of those ways is not even valid, for it says, "WorkFiles.getAmount()': not all code paths return a value" unless it has the return statement outside the if condition.
My guess is this is not Resharper doing this; those Urquell-powered cats wouldn't do such a thing, methinks.