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

◆ Narrow() [7/7]

static unsafe Vector< byte > System.Numerics.Vector< T >.Narrow ( Vector< ushort > low,
Vector< ushort > high )
inlinestatic

Definition at line 623 of file Vector.cs.

624 {
625 int count = Vector<byte>.Count;
626 byte* ptr = stackalloc byte[(int)(uint)count];
627 for (int i = 0; i < count / 2; i++)
628 {
629 ptr[i] = (byte)low[i];
630 }
631 for (int j = 0; j < count / 2; j++)
632 {
633 ptr[j + count / 2] = (byte)high[j];
634 }
635 return *(Vector<byte>*)ptr;
636 }

References System.count, and System.Numerics.Vector< T >.Count.

Referenced by System.Text.ASCIIUtility.NarrowUtf16ToAscii(), and System.Text.Latin1Utility.NarrowUtf16ToLatin1().