Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CompareOrdinal() [3/3]

static unsafe int System.Resources.FastResourceComparer.CompareOrdinal ( string a,
byte[] bytes,
int bCharLength )
inlinestatic

Definition at line 64 of file FastResourceComparer.cs.

65 {
66 int num = 0;
67 int num2 = 0;
68 int num3 = a.Length;
69 if (num3 > bCharLength)
70 {
72 }
73 if (bCharLength == 0)
74 {
75 if (a.Length != 0)
76 {
77 return -1;
78 }
79 return 0;
80 }
81 fixed (byte* ptr = bytes)
82 {
83 byte* ptr2 = ptr;
84 while (num < num3 && num2 == 0)
85 {
86 int num4 = *ptr2 | (ptr2[1] << 8);
87 num2 = a[num++] - num4;
88 ptr2 += 2;
89 }
90 }
91 if (num2 != 0)
92 {
93 return num2;
94 }
95 return a.Length - bCharLength;
96 }

References System.bytes.

Referenced by System.Resources.FastResourceComparer.CompareOrdinal(), and System.Resources.ResourceReader.CompareStringEqualsName().