fix warnings

This commit is contained in:
zznty
2023-11-12 14:51:56 +07:00
parent 989088cee8
commit aecc7ee66f
3 changed files with 7 additions and 11 deletions

View File

@@ -15,14 +15,10 @@ public static class IteratorExtensions
{
public bool MoveNext()
{
if (iterator.hasNext())
{
Current = iterator.next() is T ? (T)iterator.next() : default;
return true;
}
Current = default;
return false;
if (!iterator.hasNext()) return false;
Current = (T)iterator.next();
return true;
}
public void Reset()
@@ -32,7 +28,7 @@ public static class IteratorExtensions
object? IEnumerator.Current => Current;
public T? Current { get; private set; }
public T Current { get; private set; }
public void Dispose()
{