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

◆ ReadOnlySpan() [2/4]

System.ReadOnlySpan< T >.ReadOnlySpan ( T?[] array,
int start,
int length )
inline

Definition at line 102 of file ReadOnlySpan.cs.

103 {
104 if (array == null)
105 {
106 if (start != 0 || length != 0)
107 {
108 ThrowHelper.ThrowArgumentOutOfRangeException();
109 }
110 this = default(ReadOnlySpan<T>);
111 return;
112 }
113 if ((ulong)((long)(uint)start + (long)(uint)length) > (ulong)(uint)array.Length)
114 {
115 ThrowHelper.ThrowArgumentOutOfRangeException();
116 }
117 _pointer = new ByReference<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), (nint)(uint)start));
118 _length = length;
119 }
static unsafe ref byte GetArrayDataReference(Array array)
readonly int _length
readonly ByReference< T > _pointer

References System.ReadOnlySpan< T >._length, System.ReadOnlySpan< T >._pointer, System.array, System.Runtime.InteropServices.MemoryMarshal.GetArrayDataReference(), System.length, System.start, and System.ThrowHelper.ThrowArgumentOutOfRangeException().