Skip to content

Commit 4bcd94d

Browse files
committed
Replace soft cancellation with ThrowIfCancellationRequested
1 parent e6cfbd0 commit 4bcd94d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Ramstack.FileSystem.Abstractions/Utilities/EnumerableExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ private sealed class AsyncEnumeratorAdapter<T>(IEnumerator<T> enumerator, Cancel
4848
/// <inheritdoc />
4949
public ValueTask<bool> MoveNextAsync()
5050
{
51-
var result = !cancellationToken.IsCancellationRequested && enumerator.MoveNext();
52-
return new ValueTask<bool>(result);
51+
cancellationToken.ThrowIfCancellationRequested();
52+
return new ValueTask<bool>(enumerator.MoveNext());
5353
}
5454

5555
/// <inheritdoc />

0 commit comments

Comments
 (0)