Skip to content

Commit d2f87f4

Browse files
Implement interfaces in the non-generic enumerator base (#82923)
* Implement IDisposable in the non-generic enumerator base ...so that the interface implementation details go to the non-generic dispatch map. Saves 1.5 kB on BasicMinimalApi. * f
1 parent 66465ef commit d2f87f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/System.Private.CoreLib/src/System/Array.Enumerators.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void Reset()
6767
}
6868
}
6969

70-
internal abstract class SZGenericArrayEnumeratorBase
70+
internal abstract class SZGenericArrayEnumeratorBase : IDisposable
7171
{
7272
protected readonly Array _array;
7373
protected int _index;
@@ -141,7 +141,7 @@ public T Current
141141
object? IEnumerator.Current => Current;
142142
}
143143

144-
internal abstract class GenericEmptyEnumeratorBase
144+
internal abstract class GenericEmptyEnumeratorBase : IDisposable, IEnumerator
145145
{
146146
#pragma warning disable CA1822 // https://github.com/dotnet/roslyn-analyzers/issues/5911
147147
public bool MoveNext() => false;

0 commit comments

Comments
 (0)