RCS1230: Unnecessary explicit use of enumerator
Properties
Property | Value |
---|---|
Default Severity | Info |
Minimum language version | - |
Examples
Example #1
diagnostic.cs
using (var en = items.GetEnumerator())
{
while (en.MoveNext())
{
yield return en.Current;
}
}
fix.cs
foreach (var item in items)
{
yield return item;
}