Open ghost opened 2 years ago
Hm... Although the error message is misleading, I would still say that such code should be fixed. Instead of comparing constants, I'd recommend to use the result of the comparison directly. Or do you see a case where you would want to keep the constant comparison?
Desired change
Explanation
These comparisons are pointless, but swapping them around (only to be told to swap them around again after) is also pointless.
Example
Example 1
Example 2