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

◆ Min() [4/10]

static ? double System.Linq.Enumerable.Min ( this IEnumerable< double?> source)
inlinestatic

Definition at line 6529 of file Enumerable.cs.

6530 {
6531 if (source == null)
6532 {
6533 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
6534 }
6535 double? result = null;
6536 using IEnumerator<double?> enumerator = source.GetEnumerator();
6537 while (enumerator.MoveNext())
6538 {
6539 result = enumerator.Current;
6540 if (!result.HasValue)
6541 {
6542 continue;
6543 }
6544 double num = result.GetValueOrDefault();
6545 if (double.IsNaN(num))
6546 {
6547 return result;
6548 }
6549 while (enumerator.MoveNext())
6550 {
6551 double? current = enumerator.Current;
6552 if (current.HasValue)
6553 {
6554 double valueOrDefault = current.GetValueOrDefault();
6555 if (valueOrDefault < num)
6556 {
6557 num = valueOrDefault;
6558 result = current;
6559 }
6560 else if (double.IsNaN(valueOrDefault))
6561 {
6562 return current;
6563 }
6564 }
6565 }
6566 return result;
6567 }
6568 return result;
6569 }

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