Skip to content

Commit

Permalink
Remove ValueTask wrapping
Browse files Browse the repository at this point in the history
No need to wrap Task.Run in ValueTask for await.
  • Loading branch information
NN--- committed Mar 6, 2024
1 parent f876cd5 commit c28f5bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CodeJam.Main/DisposableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public static async ValueTask DisposeAsync(this IDisposable disposable)
Code.NotNull(disposable, nameof(disposable));
if (disposable is IAsyncDisposable asyncDisposable)
await asyncDisposable.DisposeAsync();
await new ValueTask(Task.Run(() => disposable.Dispose()));
await Task.Run(() => disposable.Dispose());
}
#endif
}
}
}

0 comments on commit c28f5bb

Please sign in to comment.