Skip to content

Commit c799744

Browse files
committed
Removed obsolete CanceledTask helper
1 parent 8b8d25a commit c799744

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

AsyncCollections/Internal/CancelledTask.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ namespace HellBrick.Collections.Internal
88
{
99
internal static class CanceledValueTask<T>
1010
{
11-
public static readonly ValueTask<T> Value = new ValueTask<T>( CanceledTask<T>.Value );
12-
}
11+
public static readonly ValueTask<T> Value = CreateCanceledTask();
1312

14-
internal static class CanceledTask<T>
15-
{
16-
static CanceledTask()
13+
private static ValueTask<T> CreateCanceledTask()
1714
{
1815
TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
1916
tcs.SetCanceled();
20-
Value = tcs.Task;
17+
return new ValueTask<T>( tcs.Task );
2118
}
22-
23-
public static readonly Task<T> Value;
2419
}
2520
}

0 commit comments

Comments
 (0)