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

◆ Average() [10/10]

static ? double System.Linq.Enumerable.Average ( this IEnumerable< long?> source)
inlinestatic

Definition at line 3788 of file Enumerable.cs.

3789 {
3790 if (source == null)
3791 {
3792 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3793 }
3794 checked
3795 {
3797 {
3798 while (enumerator.MoveNext())
3799 {
3800 long? current = enumerator.Current;
3801 if (!current.HasValue)
3802 {
3803 continue;
3804 }
3805 long num = current.GetValueOrDefault();
3806 long num2 = 1L;
3807 while (enumerator.MoveNext())
3808 {
3809 current = enumerator.Current;
3810 if (current.HasValue)
3811 {
3812 num += current.GetValueOrDefault();
3813 num2++;
3814 }
3815 }
3816 return (double)num / (double)num2;
3817 }
3818 }
3819 return null;
3820 }
3821 }

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