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

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

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

Definition at line 6902 of file Enumerable.cs.

6903 {
6904 if (source == null)
6905 {
6906 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6907 }
6908 if (selector == null)
6909 {
6910 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6911 }
6912 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6913 if (!enumerator.MoveNext())
6914 {
6915 ThrowHelper.ThrowNoElementsException();
6916 }
6917 float num = selector(enumerator.Current);
6918 if (float.IsNaN(num))
6919 {
6920 return num;
6921 }
6922 while (enumerator.MoveNext())
6923 {
6924 float num2 = selector(enumerator.Current);
6925 if (num2 < num)
6926 {
6927 num = num2;
6928 }
6929 else if (float.IsNaN(num2))
6930 {
6931 return num2;
6932 }
6933 }
6934 return num;
6935 }

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