using System; using System.Collections.Generic; namespace MemoryPools.Collections.Linq { public static partial class PoolingEnumerable { public static IPoolingEnumerable> GroupBy(this IPoolingEnumerable source, Func keySelector) => Pool>.Get().Init(source, keySelector, x => x, null!); public static IPoolingEnumerable> GroupBy(this IPoolingEnumerable source, Func keySelector, IEqualityComparer comparer) => Pool>.Get().Init(source, keySelector, x => x, comparer); public static IPoolingEnumerable> GroupBy(this IPoolingEnumerable source, Func keySelector, Func elementSelector) => Pool>.Get().Init(source, keySelector, elementSelector, null!); public static IPoolingEnumerable> GroupBy(this IPoolingEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) => Pool>.Get().Init(source, keySelector, elementSelector, comparer); public static IPoolingEnumerable GroupBy(this IPoolingEnumerable source, Func keySelector, Func, TResult> resultSelector) => Pool>.Get().Init(source, keySelector, resultSelector, null!); // public static IPoolingEnumerable GroupBy(this IEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector) => // new GroupedResultEnumerable(source, keySelector, elementSelector, resultSelector, null); public static IPoolingEnumerable GroupBy(this IPoolingEnumerable source, Func keySelector, Func, TResult> resultSelector, IEqualityComparer comparer) => Pool>.Get().Init(source, keySelector, resultSelector, comparer); // public static IEnumerable GroupBy(this IEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer) => // new GroupedResultEnumerable(source, keySelector, elementSelector, resultSelector, comparer); } }