Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NullableComparer.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
NullableComparer
<T> :
Comparer
<T?>
where
T :
struct
,
IComparable
<T>
9
{
10
public
override
int
Compare
(T? x, T? y)
11
{
12
if
(x.HasValue)
13
{
14
if
(y.HasValue)
15
{
16
return
x.value.CompareTo(y.value);
17
}
18
return
1;
19
}
20
if
(y.HasValue)
21
{
22
return
-1;
23
}
24
return
0;
25
}
26
27
public
override
bool
Equals
([
NotNullWhen
(
true
)]
object
?
obj
)
28
{
29
if
(
obj
!=
null
)
30
{
31
return
GetType() ==
obj
.GetType();
32
}
33
return
false
;
34
}
35
36
public
override
int
GetHashCode
()
37
{
38
return
GetType().GetHashCode();
39
}
40
}
System.Collections.Generic.Comparer
Definition
Comparer.cs:9
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.NullableComparer.Equals
override bool Equals([NotNullWhen(true)] object? obj)
Definition
NullableComparer.cs:27
System.Collections.Generic.NullableComparer.GetHashCode
override int GetHashCode()
Definition
NullableComparer.cs:36
System.Collections.Generic.NullableComparer.Compare
override int Compare(T? x, T? y)
Definition
NullableComparer.cs:10
System.Collections.Generic.NullableComparer
Definition
NullableComparer.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
Definition
NullablePublicOnlyAttribute.cs:3
System.ExceptionArgument.obj
@ obj
source
System.Private.CoreLib
System.Collections.Generic
NullableComparer.cs
Generated by
1.10.0