RCS1104: Simplify conditional expression
Properties
Property | Value |
---|---|
Default Severity | Info |
Minimum language version | - |
Examples
Example #1
diagnostic.cs
bool x = y ? true : false;
fix.cs
bool x = y;
Example #2
diagnostic.cs
bool x = y ? false : true;
fix.cs
bool x = !y;
Example #3
diagnostic.cs
bool x = y ? z : false;
fix.cs
bool x = y && z;
Example #4
diagnostic.cs
bool x = y ? true : z;
fix.cs
bool x = y || z;