Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 547 Bytes

RCS1173.md

File metadata and controls

35 lines (25 loc) · 547 Bytes

RCS1173: Use coalesce expression instead of 'if'

Property Value
Id RCS1173
Category Simplification
Severity Info

Example

Code with Diagnostic

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

Code with Fix

z = x ?? y;

See Also

(Generated with DotMarkdown)