public static TSource Aggregate <TSource>(this List <TSource> source, Func <TSource, TSource, TSource> func) { var aggregate = new ReduceForward <TSource>(func); ListSegmentNode.ProcessList(source, ref aggregate); return(aggregate.GetResult()); }
public static TSource Aggregate <TSource>(this ReadOnlyMemory <TSource> source, Func <TSource, TSource, TSource> func) { var aggregate = new ReduceForward <TSource>(func); MemoryNode.ProcessMemory(source, ref aggregate); return(aggregate.GetResult()); }
public static TSource Aggregate <TSource>(this TSource[] source, Func <TSource, TSource, TSource> func) { var aggregate = new ReduceForward <TSource>(func); ArrayNode.ProcessArray(source, ref aggregate); return(aggregate.GetResult()); }