Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Aggregate< TSource >()

static TSource System.Linq.Enumerable.Aggregate< TSource > ( this IEnumerable< TSource > source,
Func< TSource, TSource, TSource > func )
inlinestatic

Definition at line 3550 of file Enumerable.cs.

3551 {
3552 if (source == null)
3553 {
3554 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3555 }
3556 if (func == null)
3557 {
3558 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.func);
3559 }
3560 using IEnumerator<TSource> enumerator = source.GetEnumerator();
3561 if (!enumerator.MoveNext())
3562 {
3563 ThrowHelper.ThrowNoElementsException();
3564 }
3565 TSource val = enumerator.Current;
3566 while (enumerator.MoveNext())
3567 {
3568 val = func(val, enumerator.Current);
3569 }
3570 return val;
3571 }

References System.Linq.func, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Linq.source, System.Linq.ThrowHelper.ThrowArgumentNullException(), and System.Linq.ThrowHelper.ThrowNoElementsException().