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

◆ Max() [10/10]

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

Definition at line 5469 of file Enumerable.cs.

5470 {
5471 if (source == null)
5472 {
5473 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5474 }
5475 long? result = null;
5477 {
5478 do
5479 {
5480 if (!enumerator.MoveNext())
5481 {
5482 return result;
5483 }
5484 result = enumerator.Current;
5485 }
5486 while (!result.HasValue);
5487 long num = result.GetValueOrDefault();
5488 if (num >= 0)
5489 {
5490 while (enumerator.MoveNext())
5491 {
5492 long? current = enumerator.Current;
5493 long valueOrDefault = current.GetValueOrDefault();
5494 if (valueOrDefault > num)
5495 {
5496 num = valueOrDefault;
5497 result = current;
5498 }
5499 }
5500 }
5501 else
5502 {
5503 while (enumerator.MoveNext())
5504 {
5505 long? current2 = enumerator.Current;
5506 long valueOrDefault2 = current2.GetValueOrDefault();
5507 if (current2.HasValue && valueOrDefault2 > num)
5508 {
5509 num = valueOrDefault2;
5510 result = current2;
5511 }
5512 }
5513 }
5514 }
5515 return result;
5516 }

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