Remove instantiation of a local variable
Property | Value |
---|---|
Id | RR0185 |
Applicable Syntax | local variable with a new object creation |
Enabled by Default | ✓ |
Usage
Example #1
before.cs
var x = new object();
after.cs
object x = null;
Example #2
before.cs
var arr = new object[0];
after.cs
object[] arr = null;
Configuration
roslynator_refactoring.remove_instantiation_of_local_variable.enabled = true|false