defaultifempty

This commit is contained in:
neuecc
2020-05-10 22:52:12 +09:00
parent 93dd82e3d4
commit 3f082f1923
3 changed files with 38 additions and 5 deletions

View File

@@ -73,11 +73,16 @@ namespace Cysharp.Threading.Tasks.Linq
cancellationToken.ThrowIfCancellationRequested();
completionSource.Reset();
if (iteratingState == IteratingState.Empty)
if (iteratingState == IteratingState.Completed)
{
return CompletedTasks.False;
}
if (enumerator == null)
{
enumerator = source.GetAsyncEnumerator(cancellationToken);
}
awaiter = enumerator.MoveNextAsync().GetAwaiter();
if (awaiter.IsCompleted)