void Foo(int[,] foo)
{
for (int i = foo.GetLowerBound(0); i < foo.GetUpperBound(0); i++)
{
int count = i * 100;
for (int j = foo.GetLowerBound(1); j < foo.GetUpperBound(1); j++)
{
foo[i, j] = count++;
}
}
}
we generate unnecessary bounds checks on the accesses within the loop. This pattern is also what Roslyn produces for foreach over MD arrays, so we should be able to optimize it better.
For code like:
we generate unnecessary bounds checks on the accesses within the loop. This pattern is also what Roslyn produces for
foreach
over MD arrays, so we should be able to optimize it better.Reported by @richlander
category:cq theme:md-arrays skill-level:expert cost:large