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

◆ SearchCultureName()

static int System.Globalization.IcuLocaleData.SearchCultureName ( string name)
inlinestaticprivate

Definition at line 1811 of file IcuLocaleData.cs.

1812 {
1813 if (name.Length > 14)
1814 {
1815 return -1;
1816 }
1817 Span<byte> span = stackalloc byte[name.Length];
1818 for (int i = 0; i < name.Length; i++)
1819 {
1820 char c = name[i];
1821 span[i] = (((uint)(c - 65) <= 25u) ? ((byte)(c | 0x20u)) : ((byte)c));
1822 }
1823 ReadOnlySpan<byte> other = span;
1824 int num = 0;
1825 int num2 = 863;
1826 while (num <= num2)
1827 {
1828 int num3 = num + (num2 - num >> 1);
1829 int num4 = GetCultureName(num3).SequenceCompareTo(other);
1830 if (num4 == 0)
1831 {
1832 return num3;
1833 }
1834 if (num4 < 0)
1835 {
1836 num = num3 + 1;
1837 }
1838 else
1839 {
1840 num2 = num3 - 1;
1841 }
1842 }
1843 return ~num;
1844 }
static ReadOnlySpan< byte > GetCultureName(int localeNameIndice)

References System.Globalization.IcuLocaleData.GetCultureName(), and System.other.

Referenced by System.Globalization.IcuLocaleData.GetLocaleDataNumericPart(), and System.Globalization.IcuLocaleData.GetThreeLetterWindowsLanguageName().