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

◆ CompareUtf8NullTerminatedStringWithAsciiString()

unsafe int System.Reflection.Internal.MemoryBlock.CompareUtf8NullTerminatedStringWithAsciiString ( int offset,
string asciiString )
inlinepackage

Definition at line 385 of file MemoryBlock.cs.

386 {
388 byte* ptr = Pointer + offset;
389 int num = Length - offset;
390 for (int i = 0; i < asciiString.Length; i++)
391 {
392 if (i > num)
393 {
394 return -1;
395 }
396 if (*ptr != asciiString[i])
397 {
398 return *ptr - asciiString[i];
399 }
400 ptr++;
401 }
402 if (*ptr != 0)
403 {
404 return 1;
405 }
406 return 0;
407 }
void CheckBounds(int offset, int byteCount)

References System.Reflection.Internal.MemoryBlock.CheckBounds(), System.Reflection.Internal.MemoryBlock.Length, and System.offset.

Referenced by System.Reflection.Internal.MemoryBlock.BinarySearch(), and System.Reflection.Metadata.Ecma335.StringHeap.EqualsRaw().