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 1ffbbae
Show file tree
Hide file tree
Showing 2 changed files with 9 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
8 changes: 7 additions & 1 deletion src/PipelineNet/Pipelines/AsyncPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ public async Task Execute(TParameter parameter, CancellationToken cancellationTo
index++;
if (index == MiddlewareTypes.Count)
next = async (p) => await Task.FromResult(default(int)).ConfigureAwait(false);
{
next = async (p) =>
{
var completedTask = Task.FromResult(0);
await completedTask.ConfigureAwait(false);
};
}
EnsureMiddlewareNotNull(middlewareResolverResult, middlewareType);
await RunMiddlewareAsync(middlewareResolverResult, parameter2, next, cancellationToken).ConfigureAwait(false);
Expand Down

0 comments on commit 1ffbbae

Please sign in to comment.