Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SetOfValueComparer.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.Formats.Asn1
;
4
5
internal
sealed
class
SetOfValueComparer
:
IComparer
<ReadOnlyMemory<byte>>
6
{
7
internal
static
SetOfValueComparer
Instance
{
get
; } =
new
SetOfValueComparer
();
8
9
10
public
int
Compare
(
ReadOnlyMemory<byte>
x,
ReadOnlyMemory<byte>
y)
11
{
12
return
Compare
(x.Span, y.Span);
13
}
14
15
internal
static
int
Compare
(
ReadOnlySpan<byte>
x,
ReadOnlySpan<byte>
y)
16
{
17
int
num =
Math
.
Min
(x.Length, y.Length);
18
for
(
int
i = 0; i < num; i++)
19
{
20
int
num2
= x[i];
21
byte
b
= y[i];
22
int
num3
=
num2
-
b
;
23
if
(
num3
!= 0)
24
{
25
return
num3
;
26
}
27
}
28
return
x.Length - y.Length;
29
}
30
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Formats.Asn1.SetOfValueComparer.Compare
int Compare(ReadOnlyMemory< byte > x, ReadOnlyMemory< byte > y)
Definition
SetOfValueComparer.cs:10
System.Formats.Asn1.SetOfValueComparer.Instance
static SetOfValueComparer Instance
Definition
SetOfValueComparer.cs:7
System.Formats.Asn1.SetOfValueComparer.Compare
static int Compare(ReadOnlySpan< byte > x, ReadOnlySpan< byte > y)
Definition
SetOfValueComparer.cs:15
System.Formats.Asn1.SetOfValueComparer
Definition
SetOfValueComparer.cs:6
System.Math.Min
static byte Min(byte val1, byte val2)
Definition
Math.cs:912
System.Math
Definition
Math.cs:13
System.Collections.Generic.IComparer
Definition
IComparer.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.Formats.Asn1
Definition
Asn1Tag.cs:3
source
System.Formats.Asn1
System.Formats.Asn1
SetOfValueComparer.cs
Generated by
1.10.0