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

◆ Compare() [2/2]

int System.Collections.CompatibleComparer.Compare ( object a,
object b )
inline

Definition at line 24 of file CompatibleComparer.cs.

25 {
26 if (a == b)
27 {
28 return 0;
29 }
30 if (a == null)
31 {
32 return -1;
33 }
34 if (b == null)
35 {
36 return 1;
37 }
38 if (_comparer != null)
39 {
40 return _comparer.Compare(a, b);
41 }
42 if (a is IComparable comparable)
43 {
44 return comparable.CompareTo(b);
45 }
46 throw new ArgumentException(SR.Argument_ImplementIComparable);
47 }
int Compare(object? x, object? y)

References System.Collections.CompatibleComparer._comparer, System.SR.Argument_ImplementIComparable, System.comparable, and System.Collections.IComparer.Compare().