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

◆ Max() [6/10]

static ? float System.Linq.Enumerable.Max ( this IEnumerable< float?> source)
inlinestatic

Definition at line 5624 of file Enumerable.cs.

5625 {
5626 if (source == null)
5627 {
5628 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5629 }
5630 float? result = null;
5631 using IEnumerator<float?> enumerator = source.GetEnumerator();
5632 while (enumerator.MoveNext())
5633 {
5634 result = enumerator.Current;
5635 if (!result.HasValue)
5636 {
5637 continue;
5638 }
5639 float num = result.GetValueOrDefault();
5640 while (float.IsNaN(num))
5641 {
5642 if (!enumerator.MoveNext())
5643 {
5644 return result;
5645 }
5646 float? current = enumerator.Current;
5647 if (current.HasValue)
5648 {
5649 float? num2 = (result = current);
5650 num = num2.GetValueOrDefault();
5651 }
5652 }
5653 while (enumerator.MoveNext())
5654 {
5655 float? current2 = enumerator.Current;
5656 float valueOrDefault = current2.GetValueOrDefault();
5657 if (current2.HasValue && valueOrDefault > num)
5658 {
5659 num = valueOrDefault;
5660 result = current2;
5661 }
5662 }
5663 return result;
5664 }
5665 return result;
5666 }

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