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

◆ Memory() [2/6]

System.Memory< T >.Memory ( T[] array,
int start )
inlinepackage

Definition at line 84 of file Memory.cs.

85 {
86 if (array == null)
87 {
88 if (start != 0)
89 {
90 ThrowHelper.ThrowArgumentOutOfRangeException();
91 }
92 this = default(Memory<T>);
93 return;
94 }
95 if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
96 {
97 ThrowHelper.ThrowArrayTypeMismatchException();
98 }
99 if ((uint)start > (uint)array.Length)
100 {
101 ThrowHelper.ThrowArgumentOutOfRangeException();
102 }
103 _object = array;
104 _index = start;
105 _length = array.Length - start;
106 }
readonly int _length
Definition Memory.cs:19
readonly object _object
Definition Memory.cs:15
readonly int _index
Definition Memory.cs:17

References System.Memory< T >._index, System.Memory< T >._length, System.Memory< T >._object, System.array, System.start, System.ThrowHelper.ThrowArgumentOutOfRangeException(), and System.ThrowHelper.ThrowArrayTypeMismatchException().