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

◆ Max< TSource >() [8/12]

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

Definition at line 5875 of file Enumerable.cs.

5876 {
5877 if (source == null)
5878 {
5879 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5880 }
5881 if (selector == null)
5882 {
5883 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
5884 }
5885 using IEnumerator<TSource> enumerator = source.GetEnumerator();
5886 if (!enumerator.MoveNext())
5887 {
5888 ThrowHelper.ThrowNoElementsException();
5889 }
5890 int num = selector(enumerator.Current);
5891 while (enumerator.MoveNext())
5892 {
5893 int num2 = selector(enumerator.Current);
5894 if (num2 > num)
5895 {
5896 num = num2;
5897 }
5898 }
5899 return num;
5900 }

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