Skip to content

Commit

Permalink
Implement interfaces in the non-generic enumerator base (#82923)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MichalStrehovsky authored Mar 3, 2023
1 parent 66465ef commit d2f87f4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void Reset()
}
}

internal abstract class SZGenericArrayEnumeratorBase
internal abstract class SZGenericArrayEnumeratorBase : IDisposable
{
protected readonly Array _array;
protected int _index;
Expand Down Expand Up @@ -141,7 +141,7 @@ public T Current
object? IEnumerator.Current => Current;
}

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

0 comments on commit d2f87f4

Please sign in to comment.