Skip to content

Commit

Permalink
extract locals
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz96 committed Oct 26, 2024
1 parent 334eab8 commit b0a8d27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/PipelineNet/AsyncBaseMiddlewareFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ internal static async Task DisposeMiddlewareAsync(MiddlewareResolverResult middl
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
}
#else
await Task.FromResult(default(int)).ConfigureAwait(false);
var completedTask = Task.FromResult(0);
await completedTask.ConfigureAwait(false);
#endif
if (middleware is IDisposable disposable)
{
Expand Down
5 changes: 4 additions & 1 deletion src/PipelineNet/Pipelines/AsyncPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public async Task Execute(TParameter parameter, CancellationToken cancellationTo

index++;
if (index == MiddlewareTypes.Count)
next = async (p) => await Task.FromResult(default(int)).ConfigureAwait(false);
{
var completedTask = Task.FromResult(0);
next = async (p) => await completedTask.ConfigureAwait(false);
}

EnsureMiddlewareNotNull(middlewareResolverResult, middlewareType);
await RunMiddlewareAsync(middlewareResolverResult, parameter2, next, cancellationToken).ConfigureAwait(false);
Expand Down

0 comments on commit b0a8d27

Please sign in to comment.