Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
◆
BinarySearch< T, TComparable >()
[1/2]
static int System.SpanHelpers.BinarySearch<
T
,
TComparable
>
(
ref
T
spanStart
,
int
length
,
TComparable
comparable
)
inline
static
Type Constraints
TComparable
:
IComparable<T>
Definition at line
43
of file
SpanHelpers.cs
.
43
:
IComparable<T>
44
{
45
int
num = 0;
46
int
num2
=
length
- 1;
47
while
(num <=
num2
)
48
{
49
int
num3
=
num2
+ num >>> 1;
50
int
num4
=
comparable
.CompareTo(
Unsafe
.Add(
ref
spanStart
,
num3
));
51
if
(
num4
== 0)
52
{
53
return
num3
;
54
}
55
if
(
num4
> 0)
56
{
57
num =
num3
+ 1;
58
}
59
else
60
{
61
num2
=
num3
- 1;
62
}
63
}
64
return
~num;
65
}
Internal.Runtime.CompilerServices.Unsafe
Definition
Unsafe.cs:10
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.ExceptionArgument.length
@ length
System.ExceptionArgument.comparable
@ comparable
References
System.comparable
, and
System.length
.
System
SpanHelpers
Generated by
1.10.0