Permalink
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (44 sloc) 950 Bytes

RCS1103: Replace if statement with assignment

Property Value
Id RCS1103
Category Simplification
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -

Examples

Code with Diagnostic

if (condition) // RCS1103
{
    f = true;
}
else
{
    f = false;
}

Code with Fix

f = condition;

Code with Diagnostic

if (x != null) // RCS1103
{
    y = x;
}
else
{
    y = null;
}

Code with Fix

y = x;

See Also

(Generated with DotMarkdown)