示例#1
0
        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());
        }
示例#2
0
        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());
        }
示例#3
0
        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());
        }