Convert statements to if-else
Property | Value |
---|---|
Id | RR0211 |
Applicable Syntax | selected statements (first statement must be 'if' statement) |
Enabled by Default | ✓ |
Usage
Example #1
before.cs
if (x)
return 1;
if (y)
{
return 2;
}
else if (z)
{
return 3;
}
return 0;
after.cs
if (x)
{
return 1;
}
else if (y)
{
return 2;
}
else if (z)
{
return 3;
}
else
{
return 0;
}
Configuration
roslynator_refactoring.convert_statements_to_if_else.enabled = true|false