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

◆ GetFirstSpanSlow() [2/2]

static ReadOnlySpan< T > System.Buffers.ReadOnlySequence< T >.GetFirstSpanSlow ( object startObject,
int startIndex,
int endIndex,
bool hasMultipleSegments )
inlinestaticprivate

Definition at line 929 of file ReadOnlySequence.cs.

930 {
931 if (hasMultipleSegments)
932 {
934 }
935 if (typeof(T) == typeof(char) && endIndex < 0)
936 {
937 ReadOnlySpan<char> span = ((string)startObject).AsSpan(startIndex & 0x7FFFFFFF, endIndex - startIndex);
938 return MemoryMarshal.CreateReadOnlySpan(ref Internal.Runtime.CompilerServices.Unsafe.As<char, T>(ref MemoryMarshal.GetReference(span)), span.Length);
939 }
940 startIndex &= 0x7FFFFFFF;
941 return ((MemoryManager<T>)startObject).Memory.Span.Slice(startIndex, endIndex - startIndex);
942 }
static void ThrowInvalidOperationException_EndPositionNotReached()

References System.endIndex, System.ReadOnlySpan< T >.Length, System.Memory< T >.Span, System.startIndex, and System.ThrowHelper.ThrowInvalidOperationException_EndPositionNotReached().