WithCancellation

This commit is contained in:
neuecc
2020-05-08 03:48:46 +09:00
parent 61b798b6e9
commit 856a049dd0
4 changed files with 64 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ namespace Cysharp.Threading.Tasks.Linq
public UniTask<bool> MoveNextAsync()
{
if (cancellationToken.IsCancellationRequested) return CompletedTasks.False;
cancellationToken.ThrowIfCancellationRequested();
current++;

View File

@@ -50,7 +50,7 @@ namespace Cysharp.Threading.Tasks.Linq
public UniTask<bool> MoveNextAsync()
{
if (cancellationToken.IsCancellationRequested) return CompletedTasks.False;
cancellationToken.ThrowIfCancellationRequested();
if (remaining-- != 0)
{