Synopsis: | Do not make explicit comparisons to true or false |
Language: | C# |
Severity Level: | 9 |
Category: | Control flow |
Description: |
It is usually bad style to compare a Example:
while (condition == false) // wrong; bad style while (condition != true) // also wrong while (((condition == true) == true) == true) // where do you stop? while (conditio) // OK Exception: Nullable booleans are allowed to be compared to |