TypeName | ForInArrayAnalyzer |
Check Id | CC0006 |
Category | Style |
Severity | Info |
A simple iteration using a for
loop and it is not interacting
with the indexer anywhere but in a single place where it
accesses the array used in the for condition to assign it to
a variable, which is itself used isnde the for
loop.
var array = new [] { 1, 2, 3 };
for (int i = 0; i < array.Length; i++)
{
var someNumber = array[i];
//some code
}
A code fix will be presented to you that will transform the code:
var array = new [] { 1, 2, 3 };
foreach (var someNumber in array)
{
//some code
}
None
TBD