Use index initializer
Property | Value |
---|---|
Id | RR0191 |
Applicable Syntax | collection initializer |
Enabled by Default | ✓ |
Usage
Example #1
before.cs
var dic = new Dictionary<int, string>() { { 0, "0" } };
after.cs
var dic = new Dictionary<int, string>() { [0] = "0" };
Configuration
roslynator_refactoring.use_index_initializer.enabled = true|false