Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SortUtils.cs
Go to the documentation of this file.
1
namespace
System.Collections.Generic
;
2
3
internal
static
class
SortUtils
4
{
5
public
static
int
MoveNansToFront<TKey, TValue>
(
Span<TKey>
keys
,
Span<TValue>
values
)
6
{
7
int
num = 0;
8
for
(
int
i = 0; i <
keys
.Length; i++)
9
{
10
if
((
typeof
(TKey) ==
typeof
(
double
) &&
double
.IsNaN((
double
)(
object
)
keys
[i])) || (
typeof
(TKey) ==
typeof
(
float
) &&
float
.IsNaN((
float
)(
object
)
keys
[i])) || (
typeof
(TKey) ==
typeof
(
Half
) &&
Half
.
IsNaN
((
Half
)(
object
)
keys
[i])))
11
{
12
TKey val =
keys
[num];
13
keys
[num] =
keys
[i];
14
keys
[i] = val;
15
if
((uint)i < (uint)
values
.Length)
16
{
17
TValue
val2
=
values
[num];
18
values
[num] =
values
[i];
19
values
[i] =
val2
;
20
}
21
num++;
22
}
23
}
24
return
num;
25
}
26
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.SortUtils.MoveNansToFront< TKey, TValue >
static int MoveNansToFront< TKey, TValue >(Span< TKey > keys, Span< TValue > values)
Definition
SortUtils.cs:5
System.Collections.Generic.SortUtils
Definition
SortUtils.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.ExceptionArgument.keys
@ keys
System.ExceptionArgument.values
@ values
System.Half.IsNaN
static bool IsNaN(Half value)
Definition
Half.cs:170
System.Half
Definition
Half.cs:10
source
System.Private.CoreLib
System.Collections.Generic
SortUtils.cs
Generated by
1.10.0