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

◆ Equals() [2/3]

Definition at line 7 of file HashSetEqualityComparer.cs.

8 {
9 if (x == y)
10 {
11 return true;
12 }
13 if (x == null || y == null)
14 {
15 return false;
16 }
17 EqualityComparer<T> @default = EqualityComparer<T>.Default;
18 if (HashSet<T>.EqualityComparersAreEqual(x, y))
19 {
20 if (x.Count == y.Count)
21 {
22 return y.IsSubsetOfHashSetWithSameComparer(x);
23 }
24 return false;
25 }
26 foreach (T item in y)
27 {
28 bool flag = false;
29 foreach (T item2 in x)
30 {
31 if (@default.Equals(item, item2))
32 {
33 flag = true;
34 break;
35 }
36 }
37 if (!flag)
38 {
39 return false;
40 }
41 }
42 return true;
43 }

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Collections.Generic.HashSetEqualityComparer< T >.Equals(), and System.item.

Referenced by System.Collections.Generic.HashSetEqualityComparer< T >.Equals().