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

◆ Min< TSource >() [4/12]

static double System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource > source,
Func< TSource, double > selector )
inlinestatic

Definition at line 6983 of file Enumerable.cs.

6984 {
6985 if (source == null)
6986 {
6987 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6988 }
6989 if (selector == null)
6990 {
6991 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6992 }
6993 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6994 if (!enumerator.MoveNext())
6995 {
6996 ThrowHelper.ThrowNoElementsException();
6997 }
6998 double num = selector(enumerator.Current);
6999 if (double.IsNaN(num))
7000 {
7001 return num;
7002 }
7003 while (enumerator.MoveNext())
7004 {
7005 double num2 = selector(enumerator.Current);
7006 if (num2 < num)
7007 {
7008 num = num2;
7009 }
7010 else if (double.IsNaN(num2))
7011 {
7012 return num2;
7013 }
7014 }
7015 return num;
7016 }

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