Skip to content

Commit

Permalink
Remove unnecessary async state machine from DefaultHttpRetryHandler (#…
Browse files Browse the repository at this point in the history
…678)

### Motivation and Context

Small bit of unnecessary overhead.

### Description

Removes one or more allocations every time it needs to delay.
  • Loading branch information
stephentoub committed Apr 26, 2023
1 parent 56ea209 commit 4e925b8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ internal interface IDelayProvider

internal class TaskDelayProvider : IDelayProvider
{
public async Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)
public Task DelayAsync(TimeSpan delay, CancellationToken cancellationToken)
{
await Task.Delay(delay, cancellationToken).ConfigureAwait(false);
return Task.Delay(delay, cancellationToken);
}
}

Expand Down

0 comments on commit 4e925b8

Please sign in to comment.