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

◆ SequenceEqual< TSource >() [2/2]

static bool System.Linq.Enumerable.SequenceEqual< TSource > ( this IEnumerable< TSource > first,
IEnumerable< TSource > second,
IEqualityComparer< TSource >? comparer )
inlinestatic

Definition at line 7454 of file Enumerable.cs.

7455 {
7456 if (first == null)
7457 {
7458 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.first);
7459 }
7460 if (second == null)
7461 {
7462 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.second);
7463 }
7465 {
7466 if (first is TSource[] array && second is TSource[] array2)
7467 {
7469 }
7470 if (collection.Count != collection2.Count)
7471 {
7472 return false;
7473 }
7475 {
7476 if (comparer == null)
7477 {
7479 }
7480 int count = collection.Count;
7481 for (int i = 0; i < count; i++)
7482 {
7483 if (!comparer.Equals(list[i], list2[i]))
7484 {
7485 return false;
7486 }
7487 }
7488 return true;
7489 }
7490 }
7491 using IEnumerator<TSource> enumerator = first.GetEnumerator();
7492 using IEnumerator<TSource> enumerator2 = second.GetEnumerator();
7493 if (comparer == null)
7494 {
7496 }
7497 while (enumerator.MoveNext())
7498 {
7499 if (!enumerator2.MoveNext() || !comparer.Equals(enumerator.Current, enumerator2.Current))
7500 {
7501 return false;
7502 }
7503 }
7504 return !enumerator2.MoveNext();
7505 }

References System.array, System.collection, System.comparer, System.Linq.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Linq.first, System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.list, System.Linq.second, and System.Linq.ThrowHelper.ThrowArgumentNullException().