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

◆ Max() [8/10]

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

Definition at line 5397 of file Enumerable.cs.

5398 {
5399 if (source == null)
5400 {
5401 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
5402 }
5403 int? result = null;
5405 {
5406 do
5407 {
5408 if (!enumerator.MoveNext())
5409 {
5410 return result;
5411 }
5412 result = enumerator.Current;
5413 }
5414 while (!result.HasValue);
5415 int num = result.GetValueOrDefault();
5416 if (num >= 0)
5417 {
5418 while (enumerator.MoveNext())
5419 {
5420 int? current = enumerator.Current;
5421 int valueOrDefault = current.GetValueOrDefault();
5422 if (valueOrDefault > num)
5423 {
5424 num = valueOrDefault;
5425 result = current;
5426 }
5427 }
5428 }
5429 else
5430 {
5431 while (enumerator.MoveNext())
5432 {
5433 int? current2 = enumerator.Current;
5434 int valueOrDefault2 = current2.GetValueOrDefault();
5435 if (current2.HasValue && valueOrDefault2 > num)
5436 {
5437 num = valueOrDefault2;
5438 result = current2;
5439 }
5440 }
5441 }
5442 }
5443 return result;
5444 }

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