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

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

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

Definition at line 5955 of file Enumerable.cs.

5956 {
5957 if (source == null)
5958 {
5959 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5960 }
5961 if (selector == null)
5962 {
5963 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
5964 }
5965 using IEnumerator<TSource> enumerator = source.GetEnumerator();
5966 if (!enumerator.MoveNext())
5967 {
5968 ThrowHelper.ThrowNoElementsException();
5969 }
5970 long num = selector(enumerator.Current);
5971 while (enumerator.MoveNext())
5972 {
5973 long num2 = selector(enumerator.Current);
5974 if (num2 > num)
5975 {
5976 num = num2;
5977 }
5978 }
5979 return num;
5980 }

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