Skip to content

Commit

Permalink
Removes the redundant external condition (#102883)
Browse files Browse the repository at this point in the history
Since we're anyway verifying only for isCancelled, there's no reason why we're checking for `isCompleted` externally, especially given that it's an OR.
  • Loading branch information
sairohith2605 authored Jun 23, 2024
1 parent 0fc2809 commit d38e559
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,9 @@ private async Task SerializeAsync(
}

FlushResult result = await pipeWriter.FlushAsync(cancellationToken).ConfigureAwait(false);
if (result.IsCanceled || result.IsCompleted)
if (result.IsCanceled)
{
if (result.IsCanceled)
{
ThrowHelper.ThrowOperationCanceledException_PipeWriteCanceled();
}
ThrowHelper.ThrowOperationCanceledException_PipeWriteCanceled();
}
}
finally
Expand Down

0 comments on commit d38e559

Please sign in to comment.