Skip to content

Commit c6a39a5

Browse files
committed
Reuse validation method
1 parent 09e0c1c commit c6a39a5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/DotNext.Threading/Threading/Tasks/ManualResetCompletionSource.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,7 @@ public void OnCompleted(Action<object?> continuation, object? state, short token
291291

292292
private protected short? Activate(TimeSpan timeout, CancellationToken token)
293293
{
294-
if (timeout.Ticks is < 0L and not Timeout.InfiniteTicks or > Timeout.MaxTimeoutParameterTicks)
295-
throw new ArgumentOutOfRangeException(nameof(timeout));
294+
Timeout.Validate(timeout);
296295

297296
// The task can be created for the completed (but not yet consumed) source.
298297
// This workaround is needed for AsyncBridge methods

0 commit comments

Comments
 (0)