Skip to content

Commit

Permalink
Update DelegatePolyfill.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 27, 2024
1 parent b5cb088 commit 573d24a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Polyfill/DelegatePolyfill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static InvocationListEnumerator<TDelegate> EnumerateInvocationList<TDeleg
public struct InvocationListEnumerator<TDelegate>
where TDelegate : Delegate
{
private readonly Delegate[]? _delegates;
private readonly Delegate[] _delegates;
private int _index;
private TDelegate? _current;

Expand All @@ -59,13 +59,8 @@ public TDelegate Current
/// </summary>
public bool MoveNext()
{
if (_delegates == null)
{
return false;
}

int index = _index + 1;
if (index > _delegates.Length)
if (index == _delegates.Length)
{
return false;
}
Expand Down

0 comments on commit 573d24a

Please sign in to comment.