Permalink
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (24 sloc) 769 Bytes

Replace foreach with for and reverse loop

Property Value
Id RR0188
Title Replace foreach with for and reverse loop
Syntax foreach statement
Enabled by Default -

Usage

Before

foreach (object item in items)
{
    yield return item;
}

After

for (int i = items.Count - 1; i >= 0; i--)
{
    yield return items[i];
}

full list of refactorings

(Generated with DotMarkdown)