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

◆ Contains() [2/2]

static unsafe bool System.SpanHelpers.Contains ( ref char searchSpace,
char value,
int length )
inlinestatic

Definition at line 1698 of file SpanHelpers.cs.

1699 {
1700 fixed (char* ptr = &searchSpace)
1701 {
1702 char* ptr2 = ptr;
1703 char* ptr3 = ptr2 + length;
1705 {
1706 int num = ((int)ptr2 & (Unsafe.SizeOf<Vector<ushort>>() - 1)) / 2;
1707 length = (Vector<ushort>.Count - num) & (Vector<ushort>.Count - 1);
1708 }
1709 while (true)
1710 {
1711 if (length >= 4)
1712 {
1713 length -= 4;
1714 if (value == *ptr2 || value == ptr2[1] || value == ptr2[2] || value == ptr2[3])
1715 {
1716 break;
1717 }
1718 ptr2 += 4;
1719 continue;
1720 }
1721 while (length > 0)
1722 {
1723 length--;
1724 if (value == *ptr2)
1725 {
1726 goto end_IL_0079;
1727 }
1728 ptr2++;
1729 }
1731 {
1732 length = (int)((ptr3 - ptr2) & ~(Vector<ushort>.Count - 1));
1734 while (length > 0)
1735 {
1737 if (!Vector<ushort>.Zero.Equals(other))
1738 {
1739 goto end_IL_0079;
1740 }
1743 }
1744 if (ptr2 < ptr3)
1745 {
1746 length = (int)(ptr3 - ptr2);
1747 continue;
1748 }
1749 }
1750 return false;
1751 continue;
1753 break;
1754 }
1755 return true;
1756 }
1757 }
static bool IsHardwareAccelerated
Definition Vector.cs:14
static Vector< int > Equals(Vector< float > left, Vector< float > right)
Definition Vector.cs:52

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Numerics.Vector< T >.Equals(), System.Numerics.Vector< T >.IsHardwareAccelerated, System.length, System.other, and System.value.