Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ByteArrayHelpers.cs
Go to the documentation of this file.
1namespace System;
2
3internal static class ByteArrayHelpers
4{
5 internal static bool EqualsOrdinalAsciiIgnoreCase(string left, ReadOnlySpan<byte> right)
6 {
7 if (left.Length != right.Length)
8 {
9 return false;
10 }
11 for (int i = 0; i < left.Length; i++)
12 {
13 uint num = left[i];
14 uint num2 = right[i];
15 if (num - 97 <= 25)
16 {
17 num -= 32;
18 }
19 if (num2 - 97 <= 25)
20 {
21 num2 -= 32;
22 }
23 if (num != num2)
24 {
25 return false;
26 }
27 }
28 return true;
29 }
30
31 internal static bool EqualsOrdinalAscii(string left, ReadOnlySpan<byte> right)
32 {
33 if (left.Length != right.Length)
34 {
35 return false;
36 }
37 for (int i = 0; i < left.Length; i++)
38 {
39 if (left[i] != right[i])
40 {
41 return false;
42 }
43 }
44 return true;
45 }
46}
static bool EqualsOrdinalAscii(string left, ReadOnlySpan< byte > right)
static bool EqualsOrdinalAsciiIgnoreCase(string left, ReadOnlySpan< byte > right)