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

◆ EndsWithOrdinalIgnoreCaseHelper()

unsafe bool System.Globalization.CompareInfo.EndsWithOrdinalIgnoreCaseHelper ( ReadOnlySpan< char > source,
ReadOnlySpan< char > suffix,
CompareOptions options,
int * matchLengthPtr )
inlineprivate

Definition at line 1555 of file CompareInfo.cs.

1556 {
1557 int num = Math.Min(source.Length, suffix.Length);
1558 fixed (char* ptr = &MemoryMarshal.GetReference(source))
1559 {
1560 fixed (char* ptr3 = &MemoryMarshal.GetReference(suffix))
1561 {
1562 char* ptr2 = ptr + source.Length - 1;
1563 char* ptr4 = ptr3 + suffix.Length - 1;
1564 while (true)
1565 {
1566 if (num != 0)
1567 {
1568 int num2 = *ptr2;
1569 int num3 = *ptr4;
1570 if (num2 >= 128 || num3 >= 128 || HighCharTable[num2] || HighCharTable[num3])
1571 {
1572 break;
1573 }
1574 if (num2 == num3)
1575 {
1576 ptr2--;
1577 ptr4--;
1578 num--;
1579 continue;
1580 }
1581 if ((uint)(num2 - 97) <= 25u)
1582 {
1583 num2 -= 32;
1584 }
1585 if ((uint)(num3 - 97) <= 25u)
1586 {
1587 num3 -= 32;
1588 }
1589 if (num2 == num3)
1590 {
1591 ptr2--;
1592 ptr4--;
1593 num--;
1594 continue;
1595 }
1596 if ((ptr2 > ptr && *(ptr2 - 1) >= '\u0080') || (ptr4 > ptr3 && *(ptr4 - 1) >= '\u0080'))
1597 {
1598 break;
1599 }
1600 return false;
1601 }
1602 if (source.Length < suffix.Length)
1603 {
1604 if (*ptr4 >= '\u0080')
1605 {
1606 break;
1607 }
1608 return false;
1609 }
1610 if (source.Length > suffix.Length && *ptr2 >= '\u0080')
1611 {
1612 break;
1613 }
1614 if (matchLengthPtr != null)
1615 {
1616 *matchLengthPtr = suffix.Length;
1617 }
1618 return true;
1619 }
1621 }
1622 }
1623 }
static unsafe bool EndsWith(IntPtr sortHandle, char *target, int cwTargetLength, char *source, int cwSourceLength, CompareOptions options, int *matchedLength)
static ReadOnlySpan< bool > HighCharTable

References System.Globalization.CompareInfo._sortHandle, System.Runtime.Serialization.Dictionary, Interop.Globalization.EndsWith(), System.Globalization.CompareInfo.HighCharTable, System.Math.Min(), System.options, System.source, and System.suffix.

Referenced by System.Globalization.CompareInfo.IcuEndsWith().