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

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

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

Definition at line 6778 of file Enumerable.cs.

6779 {
6780 if (source == null)
6781 {
6782 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6783 }
6784 if (selector == null)
6785 {
6786 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.selector);
6787 }
6788 using IEnumerator<TSource> enumerator = source.GetEnumerator();
6789 if (!enumerator.MoveNext())
6790 {
6791 ThrowHelper.ThrowNoElementsException();
6792 }
6793 int num = selector(enumerator.Current);
6794 while (enumerator.MoveNext())
6795 {
6796 int num2 = selector(enumerator.Current);
6797 if (num2 < num)
6798 {
6799 num = num2;
6800 }
6801 }
6802 return num;
6803 }

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