AsyncKeySelectorAsyncEnumerableSorterWithCancellation<TElement, TKey>
sealed class AsyncKeySelectorAsyncEnumerableSorterWithCancellation<TElement, TKey> : AsyncEnumerableSorterBase<TElement, TKey>
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace System.Linq
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1,
1
})]
internal sealed class AsyncKeySelectorAsyncEnumerableSorterWithCancellation<[System.Runtime.CompilerServices.Nullable(2)] TElement, [System.Runtime.CompilerServices.Nullable(2)] TKey> : AsyncEnumerableSorterBase<TElement, TKey>
{
[System.Runtime.CompilerServices.Nullable(new byte[] {
1,
1,
0,
1
})]
private readonly Func<TElement, CancellationToken, ValueTask<TKey>> _keySelector;
private readonly CancellationToken _cancellationToken;
public AsyncKeySelectorAsyncEnumerableSorterWithCancellation([System.Runtime.CompilerServices.Nullable(new byte[] {
1,
1,
0,
1
})] Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer, bool descending, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] AsyncEnumerableSorter<TElement> next, CancellationToken cancellationToken)
: base(comparer, descending, next)
{
_keySelector = keySelector;
_cancellationToken = cancellationToken;
}
[AsyncStateMachine(typeof(AsyncKeySelectorAsyncEnumerableSorterWithCancellation<, >.<ComputeKeys>d__3))]
internal override ValueTask ComputeKeys(TElement[] elements, int count)
{
<ComputeKeys>d__3 stateMachine = default(<ComputeKeys>d__3);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder.Create();
stateMachine.<>4__this = this;
stateMachine.elements = elements;
stateMachine.count = count;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start<<ComputeKeys>d__3>(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
}
}