We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b8d25a commit c799744Copy full SHA for c799744
AsyncCollections/Internal/CancelledTask.cs
@@ -8,18 +8,13 @@ namespace HellBrick.Collections.Internal
8
{
9
internal static class CanceledValueTask<T>
10
11
- public static readonly ValueTask<T> Value = new ValueTask<T>( CanceledTask<T>.Value );
12
- }
+ public static readonly ValueTask<T> Value = CreateCanceledTask();
13
14
- internal static class CanceledTask<T>
15
- {
16
- static CanceledTask()
+ private static ValueTask<T> CreateCanceledTask()
17
18
TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
19
tcs.SetCanceled();
20
- Value = tcs.Task;
+ return new ValueTask<T>( tcs.Task );
21
}
22
-
23
- public static readonly Task<T> Value;
24
25
0 commit comments