Skip to content

Latest commit

 

History

History
78 lines (50 loc) · 1.01 KB

RCS1104.md

File metadata and controls

78 lines (50 loc) · 1.01 KB

RCS1104: Simplify conditional expression

Property Value
Id RCS1104
Category Simplification
Severity Info

Examples

Code with Diagnostic

bool x = y ? true : false;

Code with Fix

bool x = y;

Code with Diagnostic

bool x = y ? false : true;

Code with Fix

bool x = !y;

Code with Diagnostic

bool x = y ? z : false;

Code with Fix

bool x = y && z;

Code with Diagnostic

bool x = y ? true : z;

Code with Fix

bool x = y || z;

Options

Do not simplify conditional expression when condition is inverted

roslynator.RCS1104.suppress_when_condition_is_inverted = true

See Also

(Generated with DotMarkdown)