Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GenericComparer.cs
Go to the documentation of this file.
3
5
7[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
8public sealed class GenericComparer<T> : Comparer<T> where T : IComparable<T>
9{
10 [MethodImpl(MethodImplOptions.AggressiveInlining)]
11 public override int Compare(T? x, T? y)
12 {
13 if (x != null)
14 {
15 if (y != null)
16 {
17 return x.CompareTo(y);
18 }
19 return 1;
20 }
21 if (y != null)
22 {
23 return -1;
24 }
25 return 0;
26 }
27
28 public override bool Equals([NotNullWhen(true)] object? obj)
29 {
30 if (obj != null)
31 {
32 return GetType() == obj.GetType();
33 }
34 return false;
35 }
36
37 public override int GetHashCode()
38 {
39 return GetType().GetHashCode();
40 }
41}
override bool Equals([NotNullWhen(true)] object? obj)