Skip to content

Commit

Permalink
simplify preprocessor directives in async middleware disposal
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusz96 authored Oct 30, 2024
1 parent 30d9e42 commit aa5cfa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PipelineNet/AsyncBaseMiddlewareFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,17 @@ internal static async Task DisposeMiddlewareAsync(MiddlewareResolverResult middl
if (middleware is IAsyncDisposable asyncDisposable)
{
await asyncDisposable.DisposeAsync().ConfigureAwait(false);
return;
}
else
#else
var completedTask = Task.FromResult(0);
await completedTask.ConfigureAwait(false);
#endif
if (middleware is IDisposable disposable)
{
disposable.Dispose();
}

var completedTask = Task.FromResult(0);
await completedTask.ConfigureAwait(false);
}
}
}
Expand Down

0 comments on commit aa5cfa0

Please sign in to comment.