Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 631 Bytes

RCS1230.md

File metadata and controls

37 lines (27 loc) · 631 Bytes

RCS1230: Unnecessary usage of enumerator

Property Value
Id RCS1230
Category Readability
Severity Info

Example

Code with Diagnostic

using (var en = items.GetEnumerator()) // RCS1230
{
    while (en.MoveNext())
    {
        yield return en.Current;
    }
}

Code with Fix

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

See Also

(Generated with DotMarkdown)