diff --git a/src/UniTask.NetCore/UniTask.NetCore.csproj b/src/UniTask.NetCore/UniTask.NetCore.csproj index 3b143ae..67ca673 100644 --- a/src/UniTask.NetCore/UniTask.NetCore.csproj +++ b/src/UniTask.NetCore/UniTask.NetCore.csproj @@ -16,6 +16,7 @@ ..\UniTask\Assets\Plugins\UniTask\Runtime\Internal\UnityEqualityComparer.cs; ..\UniTask\Assets\Plugins\UniTask\Runtime\Internal\DiagnosticsExtensions.cs; ..\UniTask\Assets\Plugins\UniTask\Runtime\Internal\PlayerLoopRunner.cs; +..\UniTask\Assets\Plugins\UniTask\Runtime\Internal\ContinuationQueue.cs; ..\UniTask\Assets\Plugins\UniTask\Runtime\CancellationTokenSourceExtensions.cs; ..\UniTask\Assets\Plugins\UniTask\Runtime\EnumeratorAsyncExtensions.cs; diff --git a/src/UniTask.NetCoreSandbox/Program.cs b/src/UniTask.NetCoreSandbox/Program.cs index ca7bcb4..f63f2ff 100644 --- a/src/UniTask.NetCoreSandbox/Program.cs +++ b/src/UniTask.NetCoreSandbox/Program.cs @@ -48,6 +48,8 @@ namespace NetCoreSandbox ) { + + Console.WriteLine(item); } diff --git a/src/UniTask.NetCoreTests/Linq/Aggregate.cs b/src/UniTask.NetCoreTests/Linq/Aggregate.cs index 61ac6f7..902c1e1 100644 --- a/src/UniTask.NetCoreTests/Linq/Aggregate.cs +++ b/src/UniTask.NetCoreTests/Linq/Aggregate.cs @@ -35,7 +35,7 @@ namespace NetCoreTests.Linq xs.Should().Be(ys); } { - var xs = await UniTaskAsyncEnumerable.Range(start, count).SumAwaitCancellationAsync((x, _) => UniTask.Run(() => x)); + var xs = await UniTaskAsyncEnumerable.Range(start, count).SumAwaitWithCancellationAsync((x, _) => UniTask.Run(() => x)); var ys = Enumerable.Range(start, count).Sum(x => x); xs.Should().Be(ys); } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs index 723a010..78647ff 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs @@ -12,7 +12,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, accumulator, cancellationToken); + return Aggregate.AggregateAsync(source, accumulator, cancellationToken); } public static UniTask AggregateAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, CancellationToken cancellationToken = default) @@ -20,7 +20,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, seed, accumulator, cancellationToken); + return Aggregate.AggregateAsync(source, seed, accumulator, cancellationToken); } public static UniTask AggregateAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, Func resultSelector, CancellationToken cancellationToken = default) @@ -29,7 +29,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); - return Aggregate.InvokeAsync(source, seed, accumulator, resultSelector, cancellationToken); + return Aggregate.AggregateAsync(source, seed, accumulator, resultSelector, cancellationToken); } public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) @@ -37,7 +37,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, accumulator, cancellationToken); + return Aggregate.AggregateAwaitAsync(source, accumulator, cancellationToken); } public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) @@ -45,7 +45,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, seed, accumulator, cancellationToken); + return Aggregate.AggregateAwaitAsync(source, seed, accumulator, cancellationToken); } public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) @@ -54,7 +54,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); - return Aggregate.InvokeAsync(source, seed, accumulator, resultSelector, cancellationToken); + return Aggregate.AggregateAwaitAsync(source, seed, accumulator, resultSelector, cancellationToken); } public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) @@ -62,7 +62,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, accumulator, cancellationToken); + return Aggregate.AggregateAwaitWithCancellationAsync(source, accumulator, cancellationToken); } public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) @@ -70,7 +70,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); - return Aggregate.InvokeAsync(source, seed, accumulator, cancellationToken); + return Aggregate.AggregateAwaitWithCancellationAsync(source, seed, accumulator, cancellationToken); } public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) @@ -79,13 +79,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); - return Aggregate.InvokeAsync(source, seed, accumulator, resultSelector, cancellationToken); + return Aggregate.AggregateAwaitWithCancellationAsync(source, seed, accumulator, resultSelector, cancellationToken); } } internal static class Aggregate { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, Func accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -116,7 +116,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -138,7 +138,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, Func resultSelector, CancellationToken cancellationToken) + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, Func resultSelector, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -162,7 +162,7 @@ namespace Cysharp.Threading.Tasks.Linq // with async - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -193,7 +193,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -215,7 +215,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -240,7 +240,7 @@ namespace Cysharp.Threading.Tasks.Linq // with cancellation - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -271,7 +271,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -293,7 +293,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/All.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/All.cs index b8fb003..5d6d5f0 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/All.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/All.cs @@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return All.InvokeAsync(source, predicate, cancellationToken); + return All.AllAsync(source, predicate, cancellationToken); } public static UniTask AllAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -19,7 +19,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return All.InvokeAsync(source, predicate, cancellationToken); + return All.AllAwaitAsync(source, predicate, cancellationToken); } public static UniTask AllAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -27,13 +27,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return All.InvokeAsync(source, predicate, cancellationToken); + return All.AllAwaitWithCancellationAsync(source, predicate, cancellationToken); } } internal static class All { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + internal static async UniTask AllAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -57,7 +57,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask AllAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -81,7 +81,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask AllAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Any.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Any.cs index cf3cbfa..2d43167 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Any.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Any.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Any.InvokeAsync(source, cancellationToken); + return Any.AnyAsync(source, cancellationToken); } public static UniTask AnyAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Any.InvokeAsync(source, predicate, cancellationToken); + return Any.AnyAsync(source, predicate, cancellationToken); } public static UniTask AnyAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Any.InvokeAsync(source, predicate, cancellationToken); + return Any.AnyAwaitAsync(source, predicate, cancellationToken); } public static UniTask AnyAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,13 +34,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Any.InvokeAsync(source, predicate, cancellationToken); + return Any.AnyAwaitWithCancellationAsync(source, predicate, cancellationToken); } } internal static class Any { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + internal static async UniTask AnyAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -61,7 +61,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + internal static async UniTask AnyAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -85,7 +85,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask AnyAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -109,7 +109,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask AnyAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs index 960e113..2225f3c 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs @@ -36,10 +36,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, element, append, cancellationToken); + return new _AppendPrepend(source, element, append, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _AppendPrepend : MoveNextSource, IUniTaskAsyncEnumerator { enum State : byte { @@ -59,7 +59,7 @@ namespace Cysharp.Threading.Tasks.Linq IUniTaskAsyncEnumerator enumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable source, TSource element, bool append, CancellationToken cancellationToken) + public _AppendPrepend(IUniTaskAsyncEnumerable source, TSource element, bool append, CancellationToken cancellationToken) { this.source = source; this.element = element; @@ -108,7 +108,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_AppendPrepend)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.cs index 975fba8..b2ce42c 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -26,22 +26,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -57,22 +57,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -80,7 +80,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -88,22 +88,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -111,7 +111,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -119,22 +119,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -142,7 +142,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -150,22 +150,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -173,7 +173,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -181,22 +181,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -204,7 +204,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -212,22 +212,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -235,7 +235,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -243,22 +243,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -266,7 +266,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -274,22 +274,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -297,7 +297,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -305,22 +305,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static class Average { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Int32 sum = 0; @@ -348,7 +348,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Int32 sum = 0; @@ -376,7 +376,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int32 sum = 0; @@ -404,7 +404,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int32 sum = 0; @@ -432,7 +432,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Int64 sum = 0; @@ -460,7 +460,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Int64 sum = 0; @@ -488,7 +488,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int64 sum = 0; @@ -516,7 +516,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int64 sum = 0; @@ -544,7 +544,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Single sum = 0; @@ -572,7 +572,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Single sum = 0; @@ -600,7 +600,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Single sum = 0; @@ -628,7 +628,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Single sum = 0; @@ -656,7 +656,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Double sum = 0; @@ -684,7 +684,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Double sum = 0; @@ -712,7 +712,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Double sum = 0; @@ -740,7 +740,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Double sum = 0; @@ -768,7 +768,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Decimal sum = 0; @@ -796,7 +796,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Decimal sum = 0; @@ -824,7 +824,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Decimal sum = 0; @@ -852,7 +852,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Decimal sum = 0; @@ -880,7 +880,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Int32? sum = 0; @@ -893,7 +893,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = e.Current; if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -912,7 +912,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Int32? sum = 0; @@ -925,7 +925,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -944,7 +944,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int32? sum = 0; @@ -957,7 +957,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -976,7 +976,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int32? sum = 0; @@ -989,7 +989,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current, cancellationToken); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1008,7 +1008,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Int64? sum = 0; @@ -1021,7 +1021,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = e.Current; if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1040,7 +1040,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Int64? sum = 0; @@ -1053,7 +1053,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1072,7 +1072,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int64? sum = 0; @@ -1085,7 +1085,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1104,7 +1104,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Int64? sum = 0; @@ -1117,7 +1117,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current, cancellationToken); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1136,7 +1136,7 @@ namespace Cysharp.Threading.Tasks.Linq return (double)sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Single? sum = 0; @@ -1149,7 +1149,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = e.Current; if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1168,7 +1168,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Single? sum = 0; @@ -1181,7 +1181,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1200,7 +1200,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Single? sum = 0; @@ -1213,7 +1213,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1232,7 +1232,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Single? sum = 0; @@ -1245,7 +1245,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current, cancellationToken); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1264,7 +1264,7 @@ namespace Cysharp.Threading.Tasks.Linq return (float)(sum / count); } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Double? sum = 0; @@ -1277,7 +1277,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = e.Current; if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1296,7 +1296,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Double? sum = 0; @@ -1309,7 +1309,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1328,7 +1328,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Double? sum = 0; @@ -1341,7 +1341,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1360,7 +1360,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Double? sum = 0; @@ -1373,7 +1373,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current, cancellationToken); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1392,7 +1392,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; Decimal? sum = 0; @@ -1405,7 +1405,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = e.Current; if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1424,7 +1424,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { long count = 0; Decimal? sum = 0; @@ -1437,7 +1437,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1456,7 +1456,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Decimal? sum = 0; @@ -1469,7 +1469,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current); if (v.HasValue) { - checked + checked { sum += v.Value; count++; @@ -1488,7 +1488,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum / count; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; Decimal? sum = 0; @@ -1501,7 +1501,7 @@ namespace Cysharp.Threading.Tasks.Linq var v = await selector(e.Current, cancellationToken); if (v.HasValue) { - checked + checked { sum += v.Value; count++; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.tt b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.tt index 003094e..9009fd1 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.tt +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Average.tt @@ -39,7 +39,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Average.InvokeAsync(source, cancellationToken); + return Average.AverageAsync(source, cancellationToken); } public static UniTask<<#= ret #>> AverageAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -47,7 +47,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAsync(source, selector, cancellationToken); } public static UniTask<<#= ret #>> AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) @@ -55,15 +55,15 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitAsync(source, selector, cancellationToken); } - public static UniTask<<#= ret #>> AverageAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + public static UniTask<<#= ret #>> AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Average.InvokeAsync(source, selector, cancellationToken); + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); } <# } #> @@ -72,7 +72,7 @@ namespace Cysharp.Threading.Tasks.Linq internal static class Average { <# foreach(var (t, ret) in types) { #> - public static async UniTask<<#= ret #>> InvokeAsync(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) + public static async UniTask<<#= ret #>> AverageAsync(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) { long count = 0; <#= TypeName(t) #> sum = 0; @@ -112,7 +112,7 @@ namespace Cysharp.Threading.Tasks.Linq return <#= CalcResult(t) #>; } - public static async UniTask<<#= ret #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask<<#= ret #>> AverageAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { long count = 0; <#= TypeName(t) #> sum = 0; @@ -152,7 +152,7 @@ namespace Cysharp.Threading.Tasks.Linq return <#= CalcResult(t) #>; } - public static async UniTask<<#= ret #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= ret #>> AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { long count = 0; <#= TypeName(t) #> sum = 0; @@ -192,7 +192,7 @@ namespace Cysharp.Threading.Tasks.Linq return <#= CalcResult(t) #>; } - public static async UniTask<<#= ret #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= ret #>> AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { long count = 0; <#= TypeName(t) #> sum = 0; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs index f29af41..be666b8 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs @@ -38,10 +38,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, cancellationToken); + return new _Buffer(source, count, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator> + sealed class _Buffer : MoveNextSource, IUniTaskAsyncEnumerator> { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -56,7 +56,7 @@ namespace Cysharp.Threading.Tasks.Linq bool completed; List buffer; - public Enumerator(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + public _Buffer(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) { this.source = source; this.count = count; @@ -128,7 +128,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Buffer)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -191,10 +191,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, skip, cancellationToken); + return new _BufferSkip(source, count, skip, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator> + sealed class _BufferSkip : MoveNextSource, IUniTaskAsyncEnumerator> { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -211,7 +211,7 @@ namespace Cysharp.Threading.Tasks.Linq Queue> buffers; int index = 0; - public Enumerator(IUniTaskAsyncEnumerable source, int count, int skip, CancellationToken cancellationToken) + public _BufferSkip(IUniTaskAsyncEnumerable source, int count, int skip, CancellationToken cancellationToken) { this.source = source; this.count = count; @@ -282,7 +282,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_BufferSkip)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs index 9a27f72..0a0c0f8 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs @@ -25,12 +25,12 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _Cast(source, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Cast : AsyncEnumeratorBase { - public Enumerator(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public _Cast(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs index 45aab70..e087f98 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs @@ -28,10 +28,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, cancellationToken); + return new _Concat(first, second, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _Concat : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -51,7 +51,7 @@ namespace Cysharp.Threading.Tasks.Linq IUniTaskAsyncEnumerator enumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, CancellationToken cancellationToken) + public _Concat(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, CancellationToken cancellationToken) { this.first = first; this.second = second; @@ -108,7 +108,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Concat)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs index e38601c..a93f566 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs @@ -17,13 +17,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return Contains.InvokeAsync(source, value, comparer, cancellationToken); + return Contains.ContainsAsync(source, value, comparer, cancellationToken); } } internal static class Contains { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, TSource value, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask ContainsAsync(IUniTaskAsyncEnumerable source, TSource value, IEqualityComparer comparer, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Count.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Count.cs index 1cdcda3..807b529 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Count.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Count.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Count.InvokeAsync(source, cancellationToken); + return Count.CountAsync(source, cancellationToken); } public static UniTask CountAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Count.InvokeAsync(source, predicate, cancellationToken); + return Count.CountAsync(source, predicate, cancellationToken); } public static UniTask CountAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Count.InvokeAsync(source, predicate, cancellationToken); + return Count.CountAwaitAsync(source, predicate, cancellationToken); } public static UniTask CountAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,13 +34,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Count.InvokeAsync(source, predicate, cancellationToken); + return Count.CountAwaitWithCancellationAsync(source, predicate, cancellationToken); } } internal static class Count { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + internal static async UniTask CountAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { var count = 0; @@ -63,7 +63,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + internal static async UniTask CountAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) { var count = 0; @@ -89,7 +89,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask CountAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var count = 0; @@ -115,7 +115,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask CountAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { var count = 0; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs index e8d3662..da3be3f 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs @@ -34,10 +34,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, defaultValue, cancellationToken); + return new _DefaultIfEmpty(source, defaultValue, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _DefaultIfEmpty : MoveNextSource, IUniTaskAsyncEnumerator { enum IteratingState : byte { @@ -56,7 +56,7 @@ namespace Cysharp.Threading.Tasks.Linq IUniTaskAsyncEnumerator enumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable source, TSource defaultValue, CancellationToken cancellationToken) + public _DefaultIfEmpty(IUniTaskAsyncEnumerable source, TSource defaultValue, CancellationToken cancellationToken) { this.source = source; this.defaultValue = defaultValue; @@ -99,7 +99,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_DefaultIfEmpty)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs index 2868fcd..85bf795 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs @@ -59,7 +59,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return new DistinctAwaitCancellation(source, keySelector, comparer); + return new DistinctAwaitWithCancellation(source, keySelector, comparer); } } @@ -76,14 +76,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, comparer, cancellationToken); + return new _Distinct(source, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Distinct : AsyncEnumeratorBase { readonly HashSet set; - public Enumerator(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + public _Distinct(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -129,15 +129,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _Distinct(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Distinct : AsyncEnumeratorBase { readonly HashSet set; readonly Func keySelector; - public Enumerator(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _Distinct(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -184,15 +184,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _DistinctAwait(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _DistinctAwait : AsyncEnumeratorAwaitSelectorBase { readonly HashSet set; readonly Func> keySelector; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -222,13 +222,13 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal sealed class DistinctAwaitCancellation : IUniTaskAsyncEnumerable + internal sealed class DistinctAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> keySelector; readonly IEqualityComparer comparer; - public DistinctAwaitCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + public DistinctAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) { this.source = source; this.keySelector = keySelector; @@ -237,15 +237,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _DistinctAwaitWithCancellation(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _DistinctAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly HashSet set; readonly Func> keySelector; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs index 4f25336..f84228d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs @@ -59,7 +59,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return new DistinctUntilChangedAwaitCancellation(source, keySelector, comparer); + return new DistinctUntilChangedAwaitWithCancellation(source, keySelector, comparer); } } @@ -76,16 +76,16 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, comparer, cancellationToken); + return new _DistinctUntilChanged(source, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _DistinctUntilChanged : AsyncEnumeratorBase { readonly IEqualityComparer comparer; TSource prev; bool first; - public Enumerator(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctUntilChanged(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -133,17 +133,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _DistinctUntilChanged(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _DistinctUntilChanged : AsyncEnumeratorBase { readonly IEqualityComparer comparer; readonly Func keySelector; TKey prev; bool first; - public Enumerator(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctUntilChanged(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -194,17 +194,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _DistinctUntilChangedAwait(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _DistinctUntilChangedAwait : AsyncEnumeratorAwaitSelectorBase { readonly IEqualityComparer comparer; readonly Func> keySelector; TKey prev; bool first; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctUntilChangedAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -237,13 +237,13 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal sealed class DistinctUntilChangedAwaitCancellation : IUniTaskAsyncEnumerable + internal sealed class DistinctUntilChangedAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> keySelector; readonly IEqualityComparer comparer; - public DistinctUntilChangedAwaitCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + public DistinctUntilChangedAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) { this.source = source; this.keySelector = keySelector; @@ -252,17 +252,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, comparer, cancellationToken); + return new _DistinctUntilChangedAwaitWithCancellation(source, keySelector, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _DistinctUntilChangedAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly IEqualityComparer comparer; readonly Func> keySelector; TKey prev; bool first; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _DistinctUntilChangedAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Do.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Do.cs index 9cb3f41..a1d7b12 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Do.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Do.cs @@ -101,10 +101,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, onNext, onError, onCompleted, cancellationToken); + return new _Do(source, onNext, onError, onCompleted, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _Do : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -117,7 +117,7 @@ namespace Cysharp.Threading.Tasks.Linq IUniTaskAsyncEnumerator enumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + public _Do(IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) { this.source = source; this.onNext = onNext; @@ -199,7 +199,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Do)state; if (self.TryGetResultWithNotification(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs index 03450f4..930675e 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs @@ -10,20 +10,20 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return ElementAt.InvokeAsync(source, index, cancellationToken, false); + return ElementAt.ElementAtAsync(source, index, cancellationToken, false); } public static UniTask ElementAtOrDefaultAsync(this IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return ElementAt.InvokeAsync(source, index, cancellationToken, true); + return ElementAt.ElementAtAsync(source, index, cancellationToken, true); } } internal static class ElementAt { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask ElementAtAsync(IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs index 2b4adea..2f5b3a4 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs @@ -20,14 +20,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return Enumerator.Instance; + return _Empty.Instance; } - class Enumerator : IUniTaskAsyncEnumerator + class _Empty : IUniTaskAsyncEnumerator { - public static readonly IUniTaskAsyncEnumerator Instance = new Enumerator(); + public static readonly IUniTaskAsyncEnumerator Instance = new _Empty(); - Enumerator() + _Empty() { } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Except.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Except.cs index 28e565a..c405482 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Except.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Except.cs @@ -40,10 +40,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, comparer, cancellationToken); + return new _Except(first, second, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Except : AsyncEnumeratorBase { static Action HashSetAsyncCoreDelegate = HashSetAsyncCore; @@ -53,7 +53,7 @@ namespace Cysharp.Threading.Tasks.Linq HashSet set; UniTask>.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + public _Except(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) : base(first, cancellationToken) { @@ -81,7 +81,7 @@ namespace Cysharp.Threading.Tasks.Linq static void HashSetAsyncCore(object state) { - var self = (Enumerator)state; + var self = (_Except)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/First.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/First.cs index 9cbb2e0..da5688b 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/First.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/First.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return First.InvokeAsync(source, cancellationToken, false); + return First.FirstAsync(source, cancellationToken, false); } public static UniTask FirstAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, false); + return First.FirstAsync(source, predicate, cancellationToken, false); } public static UniTask FirstAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, false); + return First.FirstAwaitAsync(source, predicate, cancellationToken, false); } public static UniTask FirstAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,14 +34,14 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, false); + return First.FirstAwaitWithCancellationAsync(source, predicate, cancellationToken, false); } public static UniTask FirstOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return First.InvokeAsync(source, cancellationToken, true); + return First.FirstAsync(source, cancellationToken, true); } public static UniTask FirstOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, true); + return First.FirstAsync(source, predicate, cancellationToken, true); } public static UniTask FirstOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -57,7 +57,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, true); + return First.FirstAwaitAsync(source, predicate, cancellationToken, true); } public static UniTask FirstOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -65,13 +65,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return First.InvokeAsync(source, predicate, cancellationToken, true); + return First.FirstAwaitWithCancellationAsync(source, predicate, cancellationToken, true); } } internal static class First { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask FirstAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -101,7 +101,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask FirstAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -133,7 +133,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask FirstAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -165,7 +165,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask FirstAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs index 600426c..e8dfb5f 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs @@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAsync(source, action, cancellationToken); } public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken = default) @@ -19,7 +19,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAsync(source, action, cancellationToken); } public static UniTask ForEachAwaitAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) @@ -27,7 +27,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAwaitAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitAsync(source, action, cancellationToken); } public static UniTask ForEachAwaitAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) @@ -35,7 +35,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAwaitAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitAsync(source, action, cancellationToken); } public static UniTask ForEachAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) @@ -43,7 +43,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAwaitWithCancellationAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitWithCancellationAsync(source, action, cancellationToken); } public static UniTask ForEachAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) @@ -51,13 +51,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(action, nameof(action)); - return Cysharp.Threading.Tasks.Linq.ForEach.InvokeAwaitWithCancellationAsync(source, action, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitWithCancellationAsync(source, action, cancellationToken); } } internal static class ForEach { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) + public static async UniTask ForEachAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -76,7 +76,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) + public static async UniTask ForEachAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -96,7 +96,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + public static async UniTask ForEachAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -115,7 +115,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + public static async UniTask ForEachAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -135,7 +135,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + public static async UniTask ForEachAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -154,7 +154,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + public static async UniTask ForEachAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs index d3fb03c..672dce7 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs @@ -235,10 +235,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, comparer, cancellationToken); + return new _GroupBy(source, keySelector, elementSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator> + sealed class _GroupBy : MoveNextSource, IUniTaskAsyncEnumerator> { readonly IUniTaskAsyncEnumerable source; readonly Func keySelector; @@ -248,7 +248,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; - public Enumerator(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -342,10 +342,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + return new _GroupBy(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupBy : MoveNextSource, IUniTaskAsyncEnumerator { readonly IUniTaskAsyncEnumerable source; readonly Func keySelector; @@ -356,7 +356,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; - public Enumerator(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -450,10 +450,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, comparer, cancellationToken); + return new _GroupByAwait(source, keySelector, elementSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator> + sealed class _GroupByAwait : MoveNextSource, IUniTaskAsyncEnumerator> { readonly IUniTaskAsyncEnumerable source; readonly Func> keySelector; @@ -463,7 +463,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -557,10 +557,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + return new _GroupByAwait(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupByAwait : MoveNextSource, IUniTaskAsyncEnumerator { readonly static Action ResultSelectCoreDelegate = ResultSelectCore; @@ -574,7 +574,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -650,7 +650,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupByAwait)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -688,10 +688,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, comparer, cancellationToken); + return new _GroupByAwaitWithCancellation(source, keySelector, elementSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator> + sealed class _GroupByAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator> { readonly IUniTaskAsyncEnumerable source; readonly Func> keySelector; @@ -701,7 +701,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -795,10 +795,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + return new _GroupByAwaitWithCancellation(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupByAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator { readonly static Action ResultSelectCoreDelegate = ResultSelectCore; @@ -812,7 +812,7 @@ namespace Cysharp.Threading.Tasks.Linq IEnumerator> groupEnumerator; UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.source = source; this.keySelector = keySelector; @@ -888,7 +888,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupByAwaitWithCancellation)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs index 1978ac2..b048132 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs @@ -62,7 +62,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); - return new GroupJoinWithCancellationAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + return new GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); } public static IUniTaskAsyncEnumerable GroupJoinAwaitWithCancellation(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) @@ -74,7 +74,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return new GroupJoinWithCancellationAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + return new GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); } } @@ -100,10 +100,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _GroupJoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupJoin : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -120,7 +120,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupJoin(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -186,7 +186,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoin)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -239,10 +239,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _GroupJoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupJoinAwait : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; readonly static Action ResultSelectCoreDelegate = ResultSelectCore; @@ -264,7 +264,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter resultAwaiter; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupJoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -330,7 +330,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwait)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -364,7 +364,7 @@ namespace Cysharp.Threading.Tasks.Linq static void OuterKeySelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwait)state; if (self.TryGetResult(self.outerKeyAwaiter, out var result)) { @@ -390,7 +390,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwait)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { @@ -411,7 +411,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal sealed class GroupJoinWithCancellationAwait : IUniTaskAsyncEnumerable + internal sealed class GroupJoinAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable outer; readonly IUniTaskAsyncEnumerable inner; @@ -420,7 +420,7 @@ namespace Cysharp.Threading.Tasks.Linq readonly Func, CancellationToken, UniTask> resultSelector; readonly IEqualityComparer comparer; - public GroupJoinWithCancellationAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + public GroupJoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) { this.outer = outer; this.inner = inner; @@ -432,10 +432,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _GroupJoinAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; readonly static Action ResultSelectCoreDelegate = ResultSelectCore; @@ -457,7 +457,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter resultAwaiter; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _GroupJoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -523,7 +523,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwaitWithCancellation)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -557,7 +557,7 @@ namespace Cysharp.Threading.Tasks.Linq static void OuterKeySelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwaitWithCancellation)state; if (self.TryGetResult(self.outerKeyAwaiter, out var result)) { @@ -583,7 +583,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_GroupJoinAwaitWithCancellation)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs index 897caa1..3faf645 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs @@ -40,10 +40,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, comparer, cancellationToken); + return new _Intersect(first, second, comparer, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Intersect : AsyncEnumeratorBase { static Action HashSetAsyncCoreDelegate = HashSetAsyncCore; @@ -53,7 +53,7 @@ namespace Cysharp.Threading.Tasks.Linq HashSet set; UniTask>.Awaiter awaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + public _Intersect(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) : base(first, cancellationToken) { @@ -81,7 +81,7 @@ namespace Cysharp.Threading.Tasks.Linq static void HashSetAsyncCore(object state) { - var self = (Enumerator)state; + var self = (_Intersect)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Join.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Join.cs index bfdf779..daf120c 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Join.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Join.cs @@ -99,10 +99,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _Join : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -122,7 +122,7 @@ namespace Cysharp.Threading.Tasks.Linq bool continueNext; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _Join(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -215,7 +215,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Join)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -284,10 +284,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _JoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _JoinAwait : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; static readonly Action OuterSelectCoreDelegate = OuterSelectCore; @@ -312,7 +312,7 @@ namespace Cysharp.Threading.Tasks.Linq bool continueNext; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _JoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -408,7 +408,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwait)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -442,7 +442,7 @@ namespace Cysharp.Threading.Tasks.Linq static void OuterSelectCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwait)state; if (self.TryGetResult(self.outerKeyAwaiter, out var key)) { @@ -465,7 +465,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwait)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { @@ -512,10 +512,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + return new _JoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _JoinAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; static readonly Action OuterSelectCoreDelegate = OuterSelectCore; @@ -540,7 +540,7 @@ namespace Cysharp.Threading.Tasks.Linq bool continueNext; - public Enumerator(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + public _JoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { this.outer = outer; this.inner = inner; @@ -636,7 +636,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwaitWithCancellation)state; if (self.TryGetResult(self.awaiter, out var result)) { @@ -670,7 +670,7 @@ namespace Cysharp.Threading.Tasks.Linq static void OuterSelectCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwaitWithCancellation)state; if (self.TryGetResult(self.outerKeyAwaiter, out var key)) { @@ -693,7 +693,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectCore(object state) { - var self = (Enumerator)state; + var self = (_JoinAwaitWithCancellation)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Last.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Last.cs index 430aedb..664bb27 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Last.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Last.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Last.InvokeAsync(source, cancellationToken, false); + return Last.LastAsync(source, cancellationToken, false); } public static UniTask LastAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, false); + return Last.LastAsync(source, predicate, cancellationToken, false); } public static UniTask LastAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, false); + return Last.LastAwaitAsync(source, predicate, cancellationToken, false); } public static UniTask LastAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,14 +34,14 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, false); + return Last.LastAwaitWithCancellationAsync(source, predicate, cancellationToken, false); } public static UniTask LastOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Last.InvokeAsync(source, cancellationToken, true); + return Last.LastAsync(source, cancellationToken, true); } public static UniTask LastOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, true); + return Last.LastAsync(source, predicate, cancellationToken, true); } public static UniTask LastOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -57,7 +57,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, true); + return Last.LastAwaitAsync(source, predicate, cancellationToken, true); } public static UniTask LastOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -65,13 +65,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return Last.InvokeAsync(source, predicate, cancellationToken, true); + return Last.LastAwaitWithCancellationAsync(source, predicate, cancellationToken, true); } } internal static class Last { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask LastAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -108,7 +108,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask LastAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -151,7 +151,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask LastAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -194,7 +194,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask LastAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs index 4460061..78ae805 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return LongCount.InvokeAsync(source, cancellationToken); + return LongCount.LongCountAsync(source, cancellationToken); } public static UniTask LongCountAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return LongCount.InvokeAsync(source, predicate, cancellationToken); + return LongCount.LongCountAsync(source, predicate, cancellationToken); } public static UniTask LongCountAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return LongCount.InvokeAsync(source, predicate, cancellationToken); + return LongCount.LongCountAwaitAsync(source, predicate, cancellationToken); } public static UniTask LongCountAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,13 +34,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return LongCount.InvokeAsync(source, predicate, cancellationToken); + return LongCount.LongCountAwaitWithCancellationAsync(source, predicate, cancellationToken); } } internal static class LongCount { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + internal static async UniTask LongCountAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { long count = 0; @@ -63,7 +63,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + internal static async UniTask LongCountAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) { long count = 0; @@ -89,7 +89,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask LongCountAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { long count = 0; @@ -115,7 +115,7 @@ namespace Cysharp.Threading.Tasks.Linq return count; } - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + internal static async UniTask LongCountAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) { long count = 0; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Max.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Max.cs index 703226d..d244a15 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Max.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Max.cs @@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -19,7 +19,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -27,21 +27,21 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static partial class Max { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { TSource value = default; var comparer = Comparer.Default; @@ -80,7 +80,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; @@ -119,7 +119,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; @@ -158,7 +158,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Min.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Min.cs index c54aaf9..8768a86 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Min.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Min.cs @@ -11,7 +11,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -19,7 +19,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -27,21 +27,21 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static partial class Min { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { TSource value = default; var comparer = Comparer.Default; @@ -80,7 +80,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; @@ -119,7 +119,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; @@ -158,7 +158,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { TResult value = default; var comparer = Comparer.Default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs index 61f4c7f..aae3541 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -26,22 +26,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -57,22 +57,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -80,7 +80,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -88,22 +88,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -111,7 +111,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -119,22 +119,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -142,7 +142,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -150,22 +150,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -173,7 +173,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -181,22 +181,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -204,7 +204,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -212,22 +212,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -235,7 +235,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -243,22 +243,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -266,7 +266,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -274,22 +274,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Min.InvokeAsync(source, cancellationToken); + return Min.MinAsync(source, cancellationToken); } public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -297,7 +297,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAsync(source, selector, cancellationToken); } public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -305,22 +305,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitAsync(source, selector, cancellationToken); } - public static UniTask MinAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Min.InvokeAsync(source, selector, cancellationToken); + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static partial class Min { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32 value = default; @@ -358,7 +358,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32 value = default; @@ -396,7 +396,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 value = default; @@ -434,7 +434,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 value = default; @@ -472,7 +472,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64 value = default; @@ -510,7 +510,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64 value = default; @@ -548,7 +548,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 value = default; @@ -586,7 +586,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 value = default; @@ -624,7 +624,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single value = default; @@ -662,7 +662,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single value = default; @@ -700,7 +700,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single value = default; @@ -738,7 +738,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single value = default; @@ -776,7 +776,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double value = default; @@ -814,7 +814,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double value = default; @@ -852,7 +852,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double value = default; @@ -890,7 +890,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double value = default; @@ -928,7 +928,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal value = default; @@ -966,7 +966,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal value = default; @@ -1004,7 +1004,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal value = default; @@ -1042,7 +1042,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal value = default; @@ -1080,7 +1080,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32? value = default; @@ -1120,7 +1120,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32? value = default; @@ -1160,7 +1160,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? value = default; @@ -1200,7 +1200,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? value = default; @@ -1240,7 +1240,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64? value = default; @@ -1280,7 +1280,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64? value = default; @@ -1320,7 +1320,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? value = default; @@ -1360,7 +1360,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? value = default; @@ -1400,7 +1400,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single? value = default; @@ -1440,7 +1440,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single? value = default; @@ -1480,7 +1480,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? value = default; @@ -1520,7 +1520,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? value = default; @@ -1560,7 +1560,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double? value = default; @@ -1600,7 +1600,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double? value = default; @@ -1640,7 +1640,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? value = default; @@ -1680,7 +1680,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? value = default; @@ -1720,7 +1720,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal? value = default; @@ -1760,7 +1760,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal? value = default; @@ -1800,7 +1800,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? value = default; @@ -1840,7 +1840,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? value = default; @@ -1888,7 +1888,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -1896,7 +1896,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -1904,22 +1904,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -1927,7 +1927,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -1935,22 +1935,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -1958,7 +1958,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -1966,22 +1966,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -1989,7 +1989,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -1997,22 +1997,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2020,7 +2020,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2028,22 +2028,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2051,7 +2051,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2059,22 +2059,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2082,7 +2082,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2090,22 +2090,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2113,7 +2113,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2121,22 +2121,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2144,7 +2144,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2152,22 +2152,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Max.InvokeAsync(source, cancellationToken); + return Max.MaxAsync(source, cancellationToken); } public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -2175,7 +2175,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAsync(source, selector, cancellationToken); } public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -2183,22 +2183,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitAsync(source, selector, cancellationToken); } - public static UniTask MaxAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Max.InvokeAsync(source, selector, cancellationToken); + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static partial class Max { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32 value = default; @@ -2236,7 +2236,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32 value = default; @@ -2274,7 +2274,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 value = default; @@ -2312,7 +2312,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 value = default; @@ -2350,7 +2350,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64 value = default; @@ -2388,7 +2388,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64 value = default; @@ -2426,7 +2426,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 value = default; @@ -2464,7 +2464,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 value = default; @@ -2502,7 +2502,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single value = default; @@ -2540,7 +2540,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single value = default; @@ -2578,7 +2578,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single value = default; @@ -2616,7 +2616,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single value = default; @@ -2654,7 +2654,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double value = default; @@ -2692,7 +2692,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double value = default; @@ -2730,7 +2730,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double value = default; @@ -2768,7 +2768,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double value = default; @@ -2806,7 +2806,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal value = default; @@ -2844,7 +2844,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal value = default; @@ -2882,7 +2882,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal value = default; @@ -2920,7 +2920,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal value = default; @@ -2958,7 +2958,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32? value = default; @@ -2998,7 +2998,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32? value = default; @@ -3038,7 +3038,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? value = default; @@ -3078,7 +3078,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? value = default; @@ -3118,7 +3118,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64? value = default; @@ -3158,7 +3158,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64? value = default; @@ -3198,7 +3198,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? value = default; @@ -3238,7 +3238,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? value = default; @@ -3278,7 +3278,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single? value = default; @@ -3318,7 +3318,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single? value = default; @@ -3358,7 +3358,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? value = default; @@ -3398,7 +3398,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? value = default; @@ -3438,7 +3438,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double? value = default; @@ -3478,7 +3478,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double? value = default; @@ -3518,7 +3518,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? value = default; @@ -3558,7 +3558,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? value = default; @@ -3598,7 +3598,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal? value = default; @@ -3638,7 +3638,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal? value = default; @@ -3678,7 +3678,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? value = default; @@ -3718,7 +3718,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? value = default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.tt b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.tt index ef4f0f8..1a95890 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.tt +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/MinMax.tt @@ -38,7 +38,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return <#= minMax #>.InvokeAsync(source, cancellationToken); + return <#= minMax #>.<#= minMax #>Async(source, cancellationToken); } public static UniTask<<#= TypeName(t) #>> <#= minMax #>Async(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -46,7 +46,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return <#= minMax #>.InvokeAsync(source, selector, cancellationToken); + return <#= minMax #>.<#= minMax #>Async(source, selector, cancellationToken); } public static UniTask<<#= TypeName(t) #>> <#= minMax #>AwaitAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) @@ -54,15 +54,15 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return <#= minMax #>.InvokeAsync(source, selector, cancellationToken); + return <#= minMax #>.<#= minMax #>AwaitAsync(source, selector, cancellationToken); } - public static UniTask<<#= TypeName(t) #>> <#= minMax #>AwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + public static UniTask<<#= TypeName(t) #>> <#= minMax #>AwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return <#= minMax #>.InvokeAsync(source, selector, cancellationToken); + return <#= minMax #>.<#= minMax #>AwaitWithCancellationAsync(source, selector, cancellationToken); } <# } #> @@ -71,7 +71,7 @@ namespace Cysharp.Threading.Tasks.Linq internal static partial class <#= minMax #> { <# foreach(var t in types) { #> - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> <#= minMax #>Async(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) { <#= TypeName(t) #> value = default; @@ -117,7 +117,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> <#= minMax #>Async(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> value = default; @@ -163,7 +163,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> <#= minMax #>AwaitAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> value = default; @@ -209,7 +209,7 @@ namespace Cysharp.Threading.Tasks.Linq return value; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> <#= minMax #>AwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> value = default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Never.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Never.cs index a735812..2dbce71 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Never.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Never.cs @@ -20,14 +20,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(cancellationToken); + return new _Never(cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _Never : IUniTaskAsyncEnumerator { CancellationToken cancellationToken; - public Enumerator(CancellationToken cancellationToken) + public _Never(CancellationToken cancellationToken) { this.cancellationToken = cancellationToken; } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs index 213cc98..fea8069 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs @@ -25,12 +25,12 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _OfType(source, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _OfType : AsyncEnumeratorBase { - public Enumerator(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public _OfType(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs index 740c0e2..ea58e72 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs @@ -407,10 +407,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(this, cancellationToken); + return new _OrderedAsyncEnumerator(this, cancellationToken); } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + class _OrderedAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator { protected readonly OrderedAsyncEnumerable parent; CancellationToken cancellationToken; @@ -418,7 +418,7 @@ namespace Cysharp.Threading.Tasks.Linq int[] map; int index; - public Enumerator(OrderedAsyncEnumerable parent, CancellationToken cancellationToken) + public _OrderedAsyncEnumerator(OrderedAsyncEnumerable parent, CancellationToken cancellationToken) { this.parent = parent; this.cancellationToken = cancellationToken; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Range.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Range.cs index 09c1f17..24a795d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Range.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Range.cs @@ -31,17 +31,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(start, end, cancellationToken); + return new _Range(start, end, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _Range : IUniTaskAsyncEnumerator { readonly int start; readonly int end; int current; CancellationToken cancellationToken; - public Enumerator(int start, int end, CancellationToken cancellationToken) + public _Range(int start, int end, CancellationToken cancellationToken) { this.start = start; this.end = end; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs index e74ddc2..db90a1a 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs @@ -26,17 +26,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(element, count, cancellationToken); + return new _Repeat(element, count, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _Repeat : IUniTaskAsyncEnumerator { readonly TElement element; readonly int count; int remaining; CancellationToken cancellationToken; - public Enumerator(TElement element, int count, CancellationToken cancellationToken) + public _Repeat(TElement element, int count, CancellationToken cancellationToken) { this.element = element; this.count = count; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Return.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Return.cs index b5364d4..ba8fa8d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Return.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Return.cs @@ -22,17 +22,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(value, cancellationToken); + return new _Return(value, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _Return : IUniTaskAsyncEnumerator { readonly TValue value; CancellationToken cancellationToken; bool called; - public Enumerator(TValue value, CancellationToken cancellationToken) + public _Return(TValue value, CancellationToken cancellationToken) { this.value = value; this.cancellationToken = cancellationToken; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs index 4a553ca..a4912e1 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs @@ -25,10 +25,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _Reverse(source, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _Reverse : MoveNextSource, IUniTaskAsyncEnumerator { readonly IUniTaskAsyncEnumerable source; CancellationToken cancellationToken; @@ -36,7 +36,7 @@ namespace Cysharp.Threading.Tasks.Linq TSource[] array; int index; - public Enumerator(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public _Reverse(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs index d541fda..97167f1 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Select.cs @@ -35,7 +35,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(selector, nameof(selector)); - return new Cysharp.Threading.Tasks.Linq.SelectAwaitInt(source, selector); + return new Cysharp.Threading.Tasks.Linq.SelectIntAwait(source, selector); } public static IUniTaskAsyncEnumerable SelectAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> selector) @@ -43,7 +43,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(selector, nameof(selector)); - return new Cysharp.Threading.Tasks.Linq.SelectAwaitCancellation(source, selector); + return new Cysharp.Threading.Tasks.Linq.SelectAwaitWithCancellation(source, selector); } public static IUniTaskAsyncEnumerable SelectAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> selector) @@ -51,7 +51,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(selector, nameof(selector)); - return new Cysharp.Threading.Tasks.Linq.SelectAwaitIntCancellation(source, selector); + return new Cysharp.Threading.Tasks.Linq.SelectIntAwaitWithCancellation(source, selector); } } @@ -68,14 +68,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _Select(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorBase + sealed class _Select : AsyncEnumeratorBase { readonly Func selector; - public Enumerator(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public _Select(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -111,15 +111,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _SelectInt(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorBase + sealed class _SelectInt : AsyncEnumeratorBase { readonly Func selector; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public _SelectInt(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -155,14 +155,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _SelectAwait(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorAwaitSelectorBase + sealed class _SelectAwait : AsyncEnumeratorAwaitSelectorBase { readonly Func> selector; - public Enumerator(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public _SelectAwait(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -176,18 +176,18 @@ namespace Cysharp.Threading.Tasks.Linq protected override bool TrySetCurrentCore(TResult awaitResult, out bool terminateIteration) { Current = awaitResult; - terminateIteration= false; + terminateIteration = false; return true; } } } - internal sealed class SelectAwaitInt : IUniTaskAsyncEnumerable + internal sealed class SelectIntAwait : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> selector; - public SelectAwaitInt(IUniTaskAsyncEnumerable source, Func> selector) + public SelectIntAwait(IUniTaskAsyncEnumerable source, Func> selector) { this.source = source; this.selector = selector; @@ -195,15 +195,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _SelectIntAwait(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorAwaitSelectorBase + sealed class _SelectIntAwait : AsyncEnumeratorAwaitSelectorBase { readonly Func> selector; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public _SelectIntAwait(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -217,18 +217,18 @@ namespace Cysharp.Threading.Tasks.Linq protected override bool TrySetCurrentCore(TResult awaitResult, out bool terminateIteration) { Current = awaitResult; - terminateIteration= false; + terminateIteration = false; return true; } } } - internal sealed class SelectAwaitCancellation : IUniTaskAsyncEnumerable + internal sealed class SelectAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> selector; - public SelectAwaitCancellation(IUniTaskAsyncEnumerable source, Func> selector) + public SelectAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector) { this.source = source; this.selector = selector; @@ -236,14 +236,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _SelectAwaitWithCancellation(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorAwaitSelectorBase + sealed class _SelectAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly Func> selector; - public Enumerator(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public _SelectAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -257,18 +257,18 @@ namespace Cysharp.Threading.Tasks.Linq protected override bool TrySetCurrentCore(TResult awaitResult, out bool terminateIteration) { Current = awaitResult; - terminateIteration= false; + terminateIteration = false; return true; } } } - internal sealed class SelectAwaitIntCancellation : IUniTaskAsyncEnumerable + internal sealed class SelectIntAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> selector; - public SelectAwaitIntCancellation(IUniTaskAsyncEnumerable source, Func> selector) + public SelectIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector) { this.source = source; this.selector = selector; @@ -276,15 +276,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector, cancellationToken); + return new _SelectIntAwaitWithCancellation(source, selector, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorAwaitSelectorBase + sealed class _SelectIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly Func> selector; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public _SelectIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) : base(source, cancellationToken) { this.selector = selector; @@ -298,7 +298,7 @@ namespace Cysharp.Threading.Tasks.Linq protected override bool TrySetCurrentCore(TResult awaitResult, out bool terminateIteration) { Current = awaitResult; - terminateIteration= false; + terminateIteration = false; return true; } } diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs index d286441..40db646 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs @@ -129,10 +129,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector1, selector2, resultSelector, cancellationToken); + return new _SelectMany(source, selector1, selector2, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _SelectMany : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; @@ -153,7 +153,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter selectedAwaiter; UniTask.Awaiter selectedDisposeAsyncAwaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Func> selector1, Func> selector2, Func resultSelector, CancellationToken cancellationToken) + public _SelectMany(IUniTaskAsyncEnumerable source, Func> selector1, Func> selector2, Func resultSelector, CancellationToken cancellationToken) { this.source = source; this.selector1 = selector1; @@ -232,7 +232,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectMany)state; if (self.TryGetResult(self.sourceAwaiter, out var result)) { @@ -267,7 +267,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SeletedSourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectMany)state; if (self.TryGetResult(self.selectedAwaiter, out var result)) { @@ -311,7 +311,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SelectedEnumeratorDisposeAsyncCore(object state) { - var self = (Enumerator)state; + var self = (_SelectMany)state; if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) { @@ -361,10 +361,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector1, selector2, resultSelector, cancellationToken); + return new _SelectManyAwait(source, selector1, selector2, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _SelectManyAwait : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; @@ -391,7 +391,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask>.Awaiter collectionSelectorAwaiter; UniTask.Awaiter resultSelectorAwaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) + public _SelectManyAwait(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) { this.source = source; this.selector1 = selector1; @@ -470,7 +470,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwait)state; if (self.TryGetResult(self.sourceAwaiter, out var result)) { @@ -513,7 +513,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SeletedSourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwait)state; if (self.TryGetResult(self.selectedAwaiter, out var result)) { @@ -563,7 +563,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SelectedEnumeratorDisposeAsyncCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwait)state; if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) { @@ -576,7 +576,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SelectorAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwait)state; if (self.TryGetResult(self.collectionSelectorAwaiter, out var result)) { @@ -587,7 +587,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectorAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwait)state; if (self.TryGetResult(self.resultSelectorAwaiter, out var result)) { @@ -635,10 +635,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, selector1, selector2, resultSelector, cancellationToken); + return new _SelectManyAwaitWithCancellation(source, selector1, selector2, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _SelectManyAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; @@ -665,7 +665,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask>.Awaiter collectionSelectorAwaiter; UniTask.Awaiter resultSelectorAwaiter; - public Enumerator(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) + public _SelectManyAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) { this.source = source; this.selector1 = selector1; @@ -744,7 +744,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwaitWithCancellation)state; if (self.TryGetResult(self.sourceAwaiter, out var result)) { @@ -787,7 +787,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SeletedSourceMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwaitWithCancellation)state; if (self.TryGetResult(self.selectedAwaiter, out var result)) { @@ -837,7 +837,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SelectedEnumeratorDisposeAsyncCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwaitWithCancellation)state; if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) { @@ -850,7 +850,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SelectorAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwaitWithCancellation)state; if (self.TryGetResult(self.collectionSelectorAwaiter, out var result)) { @@ -861,7 +861,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultSelectorAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_SelectManyAwaitWithCancellation)state; if (self.TryGetResult(self.resultSelectorAwaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs index ccef8b6..9512ea7 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs @@ -18,13 +18,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(second, nameof(second)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return SequenceEqual.InvokeAsync(first, second, comparer, cancellationToken); + return SequenceEqual.SequenceEqualAsync(first, second, comparer, cancellationToken); } } internal static class SequenceEqual { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask SequenceEqualAsync(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) { var e1 = first.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Single.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Single.cs index 512eb88..30df1b3 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Single.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Single.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return SingleOperator.InvokeAsync(source, cancellationToken, false); + return SingleOperator.SingleAsync(source, cancellationToken, false); } public static UniTask SingleAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, false); + return SingleOperator.SingleAsync(source, predicate, cancellationToken, false); } public static UniTask SingleAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -26,7 +26,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, false); + return SingleOperator.SingleAwaitAsync(source, predicate, cancellationToken, false); } public static UniTask SingleAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -34,14 +34,14 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, false); + return SingleOperator.SingleAwaitWithCancellationAsync(source, predicate, cancellationToken, false); } public static UniTask SingleOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return SingleOperator.InvokeAsync(source, cancellationToken, true); + return SingleOperator.SingleAsync(source, cancellationToken, true); } public static UniTask SingleOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, true); + return SingleOperator.SingleAsync(source, predicate, cancellationToken, true); } public static UniTask SingleOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -57,7 +57,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, true); + return SingleOperator.SingleAwaitAsync(source, predicate, cancellationToken, true); } public static UniTask SingleOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) @@ -65,13 +65,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return SingleOperator.InvokeAsync(source, predicate, cancellationToken, true); + return SingleOperator.SingleAwaitWithCancellationAsync(source, predicate, cancellationToken, true); } } internal static class SingleOperator { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask SingleAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -107,7 +107,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask SingleAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -147,7 +147,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask SingleAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try @@ -187,7 +187,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + public static async UniTask SingleAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) { var e = source.GetAsyncEnumerator(cancellationToken); try diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs index 8c46119..6f4831d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs @@ -27,16 +27,16 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, cancellationToken); + return new _Skip(source, count, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorBase + sealed class _Skip : AsyncEnumeratorBase { readonly int count; int index; - public Enumerator(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + public _Skip(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) : base(source, cancellationToken) { this.count = count; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs index 345ec3e..7b2dbc1 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs @@ -34,10 +34,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, cancellationToken); + return new _SkipLast(source, count, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _SkipLast : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -51,7 +51,7 @@ namespace Cysharp.Threading.Tasks.Linq bool continueNext; - public Enumerator(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + public _SkipLast(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) { this.source = source; this.count = count; @@ -106,7 +106,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_SkipLast)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs index ec97e42..771a2e2 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs @@ -68,14 +68,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhile(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _SkipWhile : AsyncEnumeratorBase { Func predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _SkipWhile(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -119,15 +119,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhileInt(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _SkipWhileInt : AsyncEnumeratorBase { Func predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _SkipWhileInt(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -171,14 +171,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhileAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _SkipWhileAwait : AsyncEnumeratorAwaitSelectorBase { Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _SkipWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -226,15 +226,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhileIntAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _SkipWhileIntAwait : AsyncEnumeratorAwaitSelectorBase { Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _SkipWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -281,14 +281,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhileAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _SkipWhileAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _SkipWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -335,15 +335,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _SkipWhileIntAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _SkipWhileIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _SkipWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs index c2a92ce..1101cd7 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -18,7 +18,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -26,22 +26,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -49,7 +49,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -57,22 +57,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -80,7 +80,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -88,22 +88,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -111,7 +111,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -119,22 +119,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -142,7 +142,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -150,22 +150,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -173,7 +173,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -181,22 +181,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -204,7 +204,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -212,22 +212,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -235,7 +235,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -243,22 +243,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -266,7 +266,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -274,22 +274,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) @@ -297,7 +297,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -305,22 +305,22 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } } internal static class Sum { - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32 sum = default; @@ -343,7 +343,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32 sum = default; @@ -366,7 +366,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 sum = default; @@ -389,7 +389,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32 sum = default; @@ -412,7 +412,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64 sum = default; @@ -435,7 +435,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64 sum = default; @@ -458,7 +458,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 sum = default; @@ -481,7 +481,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64 sum = default; @@ -504,7 +504,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single sum = default; @@ -527,7 +527,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single sum = default; @@ -550,7 +550,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single sum = default; @@ -573,7 +573,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single sum = default; @@ -596,7 +596,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double sum = default; @@ -619,7 +619,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double sum = default; @@ -642,7 +642,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double sum = default; @@ -665,7 +665,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double sum = default; @@ -688,7 +688,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal sum = default; @@ -711,7 +711,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal sum = default; @@ -734,7 +734,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal sum = default; @@ -757,7 +757,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal sum = default; @@ -780,7 +780,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int32? sum = default; @@ -803,7 +803,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int32? sum = default; @@ -826,7 +826,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? sum = default; @@ -849,7 +849,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int32? sum = default; @@ -872,7 +872,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Int64? sum = default; @@ -895,7 +895,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Int64? sum = default; @@ -918,7 +918,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? sum = default; @@ -941,7 +941,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Int64? sum = default; @@ -964,7 +964,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Single? sum = default; @@ -987,7 +987,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Single? sum = default; @@ -1010,7 +1010,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? sum = default; @@ -1033,7 +1033,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Single? sum = default; @@ -1056,7 +1056,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Double? sum = default; @@ -1079,7 +1079,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Double? sum = default; @@ -1102,7 +1102,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? sum = default; @@ -1125,7 +1125,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Double? sum = default; @@ -1148,7 +1148,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { Decimal? sum = default; @@ -1171,7 +1171,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) { Decimal? sum = default; @@ -1194,7 +1194,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? sum = default; @@ -1217,7 +1217,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { Decimal? sum = default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.tt b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.tt index afc23bc..a04983e 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.tt +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Sum.tt @@ -37,7 +37,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Sum.InvokeAsync(source, cancellationToken); + return Sum.SumAsync(source, cancellationToken); } public static UniTask<<#= TypeName(t) #>> SumAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) @@ -45,7 +45,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAsync(source, selector, cancellationToken); } public static UniTask<<#= TypeName(t) #>> SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) @@ -53,15 +53,15 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitAsync(source, selector, cancellationToken); } - public static UniTask<<#= TypeName(t) #>> SumAwaitCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) + public static UniTask<<#= TypeName(t) #>> SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(source, nameof(selector)); - return Sum.InvokeAsync(source, selector, cancellationToken); + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); } <# } #> @@ -70,7 +70,7 @@ namespace Cysharp.Threading.Tasks.Linq internal static class Sum { <# foreach(var t in types) { #> - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> SumAsync(IUniTaskAsyncEnumerable<<#= TypeName(t) #>> source, CancellationToken cancellationToken) { <#= TypeName(t) #> sum = default; @@ -93,7 +93,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> SumAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> sum = default; @@ -116,7 +116,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> SumAwaitAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> sum = default; @@ -139,7 +139,7 @@ namespace Cysharp.Threading.Tasks.Linq return sum; } - public static async UniTask<<#= TypeName(t) #>> InvokeAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) + public static async UniTask<<#= TypeName(t) #>> SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func>> selector, CancellationToken cancellationToken) { <#= TypeName(t) #> sum = default; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Take.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Take.cs index d632b1c..13388d8 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Take.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Take.cs @@ -27,16 +27,16 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, cancellationToken); + return new _Take(source, count, cancellationToken); } - sealed class Enumerator : AsyncEnumeratorBase + sealed class _Take : AsyncEnumeratorBase { readonly int count; int index; - public Enumerator(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + public _Take(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) : base(source, cancellationToken) { this.count = count; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs index d770c3b..ae93ec8 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs @@ -34,10 +34,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, count, cancellationToken); + return new _TakeLast(source, count, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _TakeLast : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action MoveNextCoreDelegate = MoveNextCore; @@ -52,7 +52,7 @@ namespace Cysharp.Threading.Tasks.Linq bool iterateCompleted; bool continueNext; - public Enumerator(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + public _TakeLast(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) { this.source = source; this.count = count; @@ -121,7 +121,7 @@ namespace Cysharp.Threading.Tasks.Linq static void MoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_TakeLast)state; if (self.TryGetResult(self.awaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs index 8e98292..6239c77 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs @@ -68,14 +68,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhile(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _TakeWhile : AsyncEnumeratorBase { Func predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _TakeWhile(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -113,15 +113,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhileInt(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _TakeWhileInt : AsyncEnumeratorBase { readonly Func predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _TakeWhileInt(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -159,14 +159,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhileAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _TakeWhileAwait : AsyncEnumeratorAwaitSelectorBase { Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _TakeWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { this.predicate = predicate; @@ -207,15 +207,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhileIntAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _TakeWhileIntAwait : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _TakeWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { this.predicate = predicate; @@ -256,14 +256,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhileAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _TakeWhileAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _TakeWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { this.predicate = predicate; @@ -304,15 +304,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _TakeWhileIntAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _TakeWhileIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _TakeWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { this.predicate = predicate; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs index a939559..b6994c4 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs @@ -23,15 +23,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(exception, cancellationToken); + return new _Throw(exception, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _Throw : IUniTaskAsyncEnumerator { readonly Exception exception; CancellationToken cancellationToken; - public Enumerator(Exception exception, CancellationToken cancellationToken) + public _Throw(Exception exception, CancellationToken cancellationToken) { this.exception = exception; this.cancellationToken = cancellationToken; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs index 25c56ec..3554968 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs @@ -11,13 +11,13 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Cysharp.Threading.Tasks.Linq.ToArray.InvokeAsync(source, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ToArray.ToArrayAsync(source, cancellationToken); } } internal static class ToArray { - internal static async UniTask InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + internal static async UniTask ToArrayAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs index 56d65e2..083ace0 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs @@ -12,7 +12,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToDictionary.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -21,7 +21,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, CancellationToken cancellationToken = default) @@ -30,7 +30,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -40,7 +40,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAsync(source, keySelector, elementSelector, comparer, cancellationToken); } public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) @@ -48,7 +48,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToDictionary.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -57,7 +57,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) @@ -66,7 +66,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -76,7 +76,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, elementSelector, comparer, cancellationToken); } public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) @@ -84,7 +84,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToDictionary.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -93,7 +93,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) @@ -102,7 +102,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -112,13 +112,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToDictionary.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, comparer, cancellationToken); } } internal static class ToDictionary { - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); @@ -143,7 +143,7 @@ namespace Cysharp.Threading.Tasks.Linq return dict; } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); @@ -171,7 +171,7 @@ namespace Cysharp.Threading.Tasks.Linq // with await - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); @@ -196,7 +196,7 @@ namespace Cysharp.Threading.Tasks.Linq return dict; } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); @@ -224,7 +224,7 @@ namespace Cysharp.Threading.Tasks.Linq // with cancellation - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); @@ -249,7 +249,7 @@ namespace Cysharp.Threading.Tasks.Linq return dict; } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToDictionaryAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var dict = new Dictionary(comparer); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs index ec54841..d058cb1 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs @@ -10,7 +10,7 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Cysharp.Threading.Tasks.Linq.ToHashSet.InvokeAsync(source, EqualityComparer.Default, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ToHashSet.ToHashSetAsync(source, EqualityComparer.Default, cancellationToken); } public static UniTask> ToHashSetAsync(this IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -18,13 +18,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return Cysharp.Threading.Tasks.Linq.ToHashSet.InvokeAsync(source, comparer, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ToHashSet.ToHashSetAsync(source, comparer, cancellationToken); } } internal static class ToHashSet { - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToHashSetAsync(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) { var set = new HashSet(comparer); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs index 07182c9..e6fa35e 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs @@ -10,13 +10,13 @@ namespace Cysharp.Threading.Tasks.Linq { Error.ThrowArgumentNullException(source, nameof(source)); - return Cysharp.Threading.Tasks.Linq.ToList.InvokeAsync(source, cancellationToken); + return Cysharp.Threading.Tasks.Linq.ToList.ToListAsync(source, cancellationToken); } } internal static class ToList { - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + internal static async UniTask> ToListAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) { var list = new List(); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs index 9cccec0..015c1c0 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs @@ -14,7 +14,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToLookup.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -23,7 +23,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToLookup.ToLookupAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, CancellationToken cancellationToken = default) @@ -32,7 +32,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -42,7 +42,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToLookup.ToLookupAsync(source, keySelector, elementSelector, comparer, cancellationToken); } public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) @@ -50,7 +50,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToLookup.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAwaitAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -59,7 +59,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToLookup.ToLookupAwaitAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) @@ -68,7 +68,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAwaitAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -78,7 +78,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToLookup.ToLookupAwaitAsync(source, keySelector, elementSelector, comparer, cancellationToken); } public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) @@ -86,7 +86,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); - return ToLookup.InvokeAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -95,7 +95,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, comparer, cancellationToken); + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, comparer, cancellationToken); } public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) @@ -104,7 +104,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); } public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) @@ -114,13 +114,13 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); Error.ThrowArgumentNullException(comparer, nameof(comparer)); - return ToLookup.InvokeAsync(source, keySelector, elementSelector, comparer, cancellationToken); + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, elementSelector, comparer, cancellationToken); } } internal static class ToLookup { - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); @@ -155,7 +155,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); @@ -194,7 +194,7 @@ namespace Cysharp.Threading.Tasks.Linq // with await - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); @@ -230,7 +230,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); @@ -268,7 +268,7 @@ namespace Cysharp.Threading.Tasks.Linq // with cancellation - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); @@ -304,7 +304,7 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal static async UniTask> InvokeAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + internal static async UniTask> ToLookupAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) { var pool = ArrayPool.Shared; var array = pool.Rent(16); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs index 500ce13..7867a8b 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs @@ -48,17 +48,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _ToUniTaskAsyncEnumerable(source, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _ToUniTaskAsyncEnumerable : IUniTaskAsyncEnumerator { readonly IEnumerable source; CancellationToken cancellationToken; IEnumerator enumerator; - public Enumerator(IEnumerable source, CancellationToken cancellationToken) + public _ToUniTaskAsyncEnumerable(IEnumerable source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; @@ -102,10 +102,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _ToUniTaskAsyncEnumerableTask(source, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _ToUniTaskAsyncEnumerableTask : IUniTaskAsyncEnumerator { readonly Task source; CancellationToken cancellationToken; @@ -113,7 +113,7 @@ namespace Cysharp.Threading.Tasks.Linq T current; bool called; - public Enumerator(Task source, CancellationToken cancellationToken) + public _ToUniTaskAsyncEnumerableTask(Task source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; @@ -155,10 +155,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _ToUniTaskAsyncEnumerableUniTask(source, cancellationToken); } - class Enumerator : IUniTaskAsyncEnumerator + class _ToUniTaskAsyncEnumerableUniTask : IUniTaskAsyncEnumerator { readonly UniTask source; CancellationToken cancellationToken; @@ -166,7 +166,7 @@ namespace Cysharp.Threading.Tasks.Linq T current; bool called; - public Enumerator(UniTask source, CancellationToken cancellationToken) + public _ToUniTaskAsyncEnumerableUniTask(UniTask source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; @@ -208,10 +208,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, cancellationToken); + return new _ToUniTaskAsyncEnumerableObservable(source, cancellationToken); } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, IObserver + class _ToUniTaskAsyncEnumerableObservable : MoveNextSource, IUniTaskAsyncEnumerator, IObserver { static readonly Action OnCanceledDelegate = OnCanceled; @@ -227,7 +227,7 @@ namespace Cysharp.Threading.Tasks.Linq IDisposable subscription; CancellationTokenRegistration cancellationTokenRegistration; - public Enumerator(IObservable source, CancellationToken cancellationToken) + public _ToUniTaskAsyncEnumerableObservable(IObservable source, CancellationToken cancellationToken) { this.source = source; this.cancellationToken = cancellationToken; @@ -334,7 +334,7 @@ namespace Cysharp.Threading.Tasks.Linq static void OnCanceled(object state) { - var self = (Enumerator)state; + var self = (_ToUniTaskAsyncEnumerableObservable)state; lock (self.queuedResult) { self.completionSource.TrySetCanceled(self.cancellationToken); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs index ccb5727..51cae08 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs @@ -24,17 +24,17 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(updateTiming, cancellationToken); + return new _EveryUpdate(updateTiming, cancellationToken); } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + class _EveryUpdate : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem { readonly PlayerLoopTiming updateTiming; CancellationToken cancellationToken; bool disposed; - public Enumerator(PlayerLoopTiming updateTiming, CancellationToken cancellationToken) + public _EveryUpdate(PlayerLoopTiming updateTiming, CancellationToken cancellationToken) { this.updateTiming = updateTiming; diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs index c8b6d10..d8d370d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs @@ -53,10 +53,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(dueTime, period, updateTiming, ignoreTimeScale, cancellationToken); + return new _Timer(dueTime, period, updateTiming, ignoreTimeScale, cancellationToken); } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + class _Timer : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem { readonly float dueTime; readonly float? period; @@ -68,7 +68,7 @@ namespace Cysharp.Threading.Tasks.Linq bool dueTimePhase; bool disposed; - public Enumerator(TimeSpan dueTime, TimeSpan? period, PlayerLoopTiming updateTiming, bool ignoreTimeScale, CancellationToken cancellationToken) + public _Timer(TimeSpan dueTime, TimeSpan? period, PlayerLoopTiming updateTiming, bool ignoreTimeScale, CancellationToken cancellationToken) { this.dueTime = (float)dueTime.TotalSeconds; this.period = (period == null) ? null : (float?)period.Value.TotalSeconds; @@ -161,10 +161,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(dueTimeFrameCount, periodFrameCount, updateTiming, cancellationToken); + return new _TimerFrame(dueTimeFrameCount, periodFrameCount, updateTiming, cancellationToken); } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + class _TimerFrame : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem { readonly int dueTimeFrameCount; readonly int? periodFrameCount; @@ -174,7 +174,7 @@ namespace Cysharp.Threading.Tasks.Linq bool dueTimePhase; bool disposed; - public Enumerator(int dueTimeFrameCount, int? periodFrameCount, PlayerLoopTiming updateTiming, CancellationToken cancellationToken) + public _TimerFrame(int dueTimeFrameCount, int? periodFrameCount, PlayerLoopTiming updateTiming, CancellationToken cancellationToken) { if (dueTimeFrameCount <= 0) dueTimeFrameCount = 0; if (periodFrameCount != null) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs index 6b1cdd6..2f98860 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs @@ -35,7 +35,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return new WhereAwaitInt(source, predicate); + return new WhereIntAwait(source, predicate); } public static IUniTaskAsyncEnumerable WhereAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) @@ -43,7 +43,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return new WhereAwaitCancellation(source, predicate); + return new WhereAwaitWithCancellation(source, predicate); } public static IUniTaskAsyncEnumerable WhereAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) @@ -51,7 +51,7 @@ namespace Cysharp.Threading.Tasks.Linq Error.ThrowArgumentNullException(source, nameof(source)); Error.ThrowArgumentNullException(predicate, nameof(predicate)); - return new WhereAwaitIntCancellation(source, predicate); + return new WhereIntAwaitWithCancellation(source, predicate); } } @@ -68,14 +68,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _Where(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _Where : AsyncEnumeratorBase { readonly Func predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _Where(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -118,15 +118,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _WhereInt(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorBase + class _WhereInt : AsyncEnumeratorBase { readonly Func predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + public _WhereInt(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -169,14 +169,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _WhereAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _WhereAwait : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _WhereAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -204,12 +204,12 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal sealed class WhereAwaitInt : IUniTaskAsyncEnumerable + internal sealed class WhereIntAwait : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> predicate; - public WhereAwaitInt(IUniTaskAsyncEnumerable source, Func> predicate) + public WhereIntAwait(IUniTaskAsyncEnumerable source, Func> predicate) { this.source = source; this.predicate = predicate; @@ -217,15 +217,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _WhereIntAwait(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _WhereIntAwait : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _WhereIntAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -255,12 +255,12 @@ namespace Cysharp.Threading.Tasks.Linq - internal sealed class WhereAwaitCancellation : IUniTaskAsyncEnumerable + internal sealed class WhereAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> predicate; - public WhereAwaitCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + public WhereAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) { this.source = source; this.predicate = predicate; @@ -268,14 +268,14 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _WhereAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _WhereAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _WhereAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { @@ -303,12 +303,12 @@ namespace Cysharp.Threading.Tasks.Linq } } - internal sealed class WhereAwaitIntCancellation : IUniTaskAsyncEnumerable + internal sealed class WhereIntAwaitWithCancellation : IUniTaskAsyncEnumerable { readonly IUniTaskAsyncEnumerable source; readonly Func> predicate; - public WhereAwaitIntCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + public WhereIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) { this.source = source; this.predicate = predicate; @@ -316,15 +316,15 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(source, predicate, cancellationToken); + return new _WhereIntAwaitWithCancellation(source, predicate, cancellationToken); } - class Enumerator : AsyncEnumeratorAwaitSelectorBase + class _WhereIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase { readonly Func> predicate; int index; - public Enumerator(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + public _WhereIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) : base(source, cancellationToken) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs index d646d78..41de303 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs @@ -58,10 +58,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, resultSelector, cancellationToken); + return new _Zip(first, second, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _Zip : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; @@ -78,7 +78,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter firstAwaiter; UniTask.Awaiter secondAwaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func resultSelector, CancellationToken cancellationToken) + public _Zip(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func resultSelector, CancellationToken cancellationToken) { this.first = first; this.second = second; @@ -114,7 +114,7 @@ namespace Cysharp.Threading.Tasks.Linq static void FirstMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Zip)state; if (self.TryGetResult(self.firstAwaiter, out var result)) { @@ -148,7 +148,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SecondMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_Zip)state; if (self.TryGetResult(self.secondAwaiter, out var result)) { @@ -208,10 +208,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, resultSelector, cancellationToken); + return new _ZipAwait(first, second, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _ZipAwait : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; @@ -230,7 +230,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter secondAwaiter; UniTask.Awaiter resultAwaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) + public _ZipAwait(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) { this.first = first; this.second = second; @@ -266,7 +266,7 @@ namespace Cysharp.Threading.Tasks.Linq static void FirstMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwait)state; if (self.TryGetResult(self.firstAwaiter, out var result)) { @@ -300,7 +300,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SecondMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwait)state; if (self.TryGetResult(self.secondAwaiter, out var result)) { @@ -332,7 +332,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwait)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { @@ -378,10 +378,10 @@ namespace Cysharp.Threading.Tasks.Linq public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(first, second, resultSelector, cancellationToken); + return new _ZipAwaitWithCancellation(first, second, resultSelector, cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + sealed class _ZipAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; @@ -400,7 +400,7 @@ namespace Cysharp.Threading.Tasks.Linq UniTask.Awaiter secondAwaiter; UniTask.Awaiter resultAwaiter; - public Enumerator(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) + public _ZipAwaitWithCancellation(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) { this.first = first; this.second = second; @@ -436,7 +436,7 @@ namespace Cysharp.Threading.Tasks.Linq static void FirstMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwaitWithCancellation)state; if (self.TryGetResult(self.firstAwaiter, out var result)) { @@ -470,7 +470,7 @@ namespace Cysharp.Threading.Tasks.Linq static void SecondMoveNextCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwaitWithCancellation)state; if (self.TryGetResult(self.secondAwaiter, out var result)) { @@ -502,7 +502,7 @@ namespace Cysharp.Threading.Tasks.Linq static void ResultAwaitCore(object state) { - var self = (Enumerator)state; + var self = (_ZipAwaitWithCancellation)state; if (self.TryGetResult(self.resultAwaiter, out var result)) { diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs index 2c43a31..d87848c 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs @@ -55,10 +55,10 @@ namespace Cysharp.Threading.Tasks.Triggers public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) { - return new Enumerator(GetTriggerEvent(), cancellationToken); + return new AsyncTriggerEnumerator(GetTriggerEvent(), cancellationToken); } - sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, IResolveCancelPromise + sealed class AsyncTriggerEnumerator : MoveNextSource, IUniTaskAsyncEnumerator, IResolveCancelPromise { static Action cancellationCallback = CancellationCallback; @@ -68,7 +68,7 @@ namespace Cysharp.Threading.Tasks.Triggers bool called; bool isDisposed; - public Enumerator(TriggerEvent triggerEvent, CancellationToken cancellationToken) + public AsyncTriggerEnumerator(TriggerEvent triggerEvent, CancellationToken cancellationToken) { this.triggerEvent = triggerEvent; this.cancellationToken = cancellationToken; @@ -87,7 +87,7 @@ namespace Cysharp.Threading.Tasks.Triggers static void CancellationCallback(object state) { - var self = (Enumerator)state; + var self = (AsyncTriggerEnumerator)state; self.DisposeAsync().Forget(); // sync self.completionSource.TrySetCanceled(self.cancellationToken); diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs index 6bfe1cd..c107e9f 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs @@ -489,15 +489,15 @@ namespace Cysharp.Threading.Tasks { if (this.cancellationToken1 == cancellationToken) { - return new Enumerator(unityEvent, this.cancellationToken1, CancellationToken.None); + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, CancellationToken.None); } else { - return new Enumerator(unityEvent, this.cancellationToken1, cancellationToken); + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, cancellationToken); } } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + class UnityEventHandlerAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action cancel1 = OnCanceled1; static readonly Action cancel2 = OnCanceled2; @@ -511,7 +511,7 @@ namespace Cysharp.Threading.Tasks CancellationTokenRegistration registration2; bool isDisposed; - public Enumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + public UnityEventHandlerAsyncEnumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) { this.unityEvent = unityEvent; this.cancellationToken1 = cancellationToken1; @@ -552,13 +552,13 @@ namespace Cysharp.Threading.Tasks static void OnCanceled1(object state) { - var self = (Enumerator)state; + var self = (UnityEventHandlerAsyncEnumerator)state; self.DisposeAsync().Forget(); } static void OnCanceled2(object state) { - var self = (Enumerator)state; + var self = (UnityEventHandlerAsyncEnumerator)state; self.DisposeAsync().Forget(); } @@ -593,15 +593,15 @@ namespace Cysharp.Threading.Tasks { if (this.cancellationToken1 == cancellationToken) { - return new Enumerator(unityEvent, this.cancellationToken1, CancellationToken.None); + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, CancellationToken.None); } else { - return new Enumerator(unityEvent, this.cancellationToken1, cancellationToken); + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, cancellationToken); } } - class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator + class UnityEventHandlerAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator { static readonly Action cancel1 = OnCanceled1; static readonly Action cancel2 = OnCanceled2; @@ -615,7 +615,7 @@ namespace Cysharp.Threading.Tasks CancellationTokenRegistration registration2; bool isDisposed; - public Enumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + public UnityEventHandlerAsyncEnumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) { this.unityEvent = unityEvent; this.cancellationToken1 = cancellationToken1; @@ -657,13 +657,13 @@ namespace Cysharp.Threading.Tasks static void OnCanceled1(object state) { - var self = (Enumerator)state; + var self = (UnityEventHandlerAsyncEnumerator)state; self.DisposeAsync().Forget(); } static void OnCanceled2(object state) { - var self = (Enumerator)state; + var self = (UnityEventHandlerAsyncEnumerator)state; self.DisposeAsync().Forget(); } diff --git a/src/UniTask/Assets/Scenes/SandboxMain.cs b/src/UniTask/Assets/Scenes/SandboxMain.cs index 9b94c40..38cd346 100644 --- a/src/UniTask/Assets/Scenes/SandboxMain.cs +++ b/src/UniTask/Assets/Scenes/SandboxMain.cs @@ -151,10 +151,13 @@ public class SandboxMain : MonoBehaviour await UniTask.Yield(PlayerLoopTiming.Update); Debug.Log("Start:" + Time.frameCount); - await UniTaskAsyncEnumerable.TimerFrame(3, 5, PlayerLoopTiming.Update).ForEachAsync(_ => - { - Debug.Log("Call:" + Time.frameCount); - }, cancellationToken: this.GetCancellationTokenOnDestroy()); + await UniTaskAsyncEnumerable.TimerFrame(3, 5, PlayerLoopTiming.PostLateUpdate) + .Select(x => x) + .Do(x => Debug.Log("DODODO")) + .ForEachAsync(_ => + { + Debug.Log("Call:" + Time.frameCount); + }, cancellationToken: this.GetCancellationTokenOnDestroy()); //try //{