Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
GenericComparer.cs
Go to the documentation of this file.
1
using
System.Diagnostics.CodeAnalysis
;
2
using
System.Runtime.CompilerServices
;
3
4
namespace
System.Collections.Generic
;
5
6
[
Serializable
]
7
[TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
)]
8
public
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
}
System.Collections.Generic.Comparer
Definition
Comparer.cs:9
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.GenericComparer.GetHashCode
override int GetHashCode()
Definition
GenericComparer.cs:37
System.Collections.Generic.GenericComparer.Equals
override bool Equals([NotNullWhen(true)] object? obj)
Definition
GenericComparer.cs:28
System.Collections.Generic.GenericComparer.Compare
override int Compare(T? x, T? y)
Definition
GenericComparer.cs:11
System.Collections.Generic.GenericComparer
Definition
GenericComparer.cs:9
System.IComparable
Definition
IComparable.cs:8
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Data.IsolationLevel.Serializable
@ Serializable
System.Diagnostics.CodeAnalysis
Definition
AllowNullAttribute.cs:1
System.Runtime.CompilerServices.MethodImplOptions
MethodImplOptions
Definition
MethodImplOptions.cs:5
System.Runtime.CompilerServices
Definition
NullablePublicOnlyAttribute.cs:3
System.ExceptionArgument.obj
@ obj
source
System.Private.CoreLib
System.Collections.Generic
GenericComparer.cs
Generated by
1.10.0