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

◆ AppendLiteral()

bool System.MemoryExtensions.TryWriteInterpolatedStringHandler.AppendLiteral ( string value)
inline

Definition at line 46 of file MemoryExtensions.cs.

47 {
48 if (value.Length == 1)
49 {
51 int pos = _pos;
52 if ((uint)pos < (uint)destination.Length)
53 {
54 destination[pos] = value[0];
55 _pos = pos + 1;
56 return true;
57 }
58 return Fail();
59 }
60 if (value.Length == 2)
61 {
63 int pos2 = _pos;
64 if ((uint)pos2 < destination2.Length - 1)
65 {
66 Unsafe.WriteUnaligned(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(destination2), pos2)), Unsafe.ReadUnaligned<int>(ref Unsafe.As<char, byte>(ref value.GetRawStringData())));
67 _pos = pos2 + 2;
68 return true;
69 }
70 return Fail();
71 }
73 }

References System.MemoryExtensions.TryWriteInterpolatedStringHandler._destination, System.MemoryExtensions.TryWriteInterpolatedStringHandler._pos, System.MemoryExtensions.TryWriteInterpolatedStringHandler.AppendStringDirect(), System.destination, System.MemoryExtensions.TryWriteInterpolatedStringHandler.Fail(), and System.value.