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

◆ TrimEnd()

static MemoryBlock System.Reflection.Metadata.Ecma335.StringHeap.TrimEnd ( MemoryBlock block)
inlinestaticprivate

Definition at line 35 of file StringHeap.cs.

36 {
37 if (block.Length == 0)
38 {
39 return block;
40 }
41 int num = block.Length - 1;
42 while (num >= 0 && block.PeekByte(num) == 0)
43 {
44 num--;
45 }
46 if (num == block.Length - 1)
47 {
48 return block;
49 }
50 return block.GetMemoryBlockAt(0, num + 2);
51 }
unsafe MemoryBlock GetMemoryBlockAt(int offset, int length)

References System.Reflection.Internal.MemoryBlock.GetMemoryBlockAt(), System.Reflection.Internal.MemoryBlock.Length, and System.Reflection.Internal.MemoryBlock.PeekByte().

Referenced by System.Reflection.Metadata.Ecma335.StringHeap.StringHeap().