diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs | 111 |
1 files changed, 1 insertions, 110 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs b/src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs index d13d3e8ce..c431e462b 100644 --- a/src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs +++ b/src/System.Private.CoreLib/shared/System/Globalization/TextInfo.Unix.cs @@ -13,116 +13,7 @@ namespace System.Globalization { private Tristate _needsTurkishCasing = Tristate.NotInitialized; - private void FinishInitialization() - { - } - - private unsafe string ChangeCase(string s, bool toUpper) - { - Debug.Assert(!_invariantMode); - - Debug.Assert(s != null); - - if (s.Length == 0) - { - return string.Empty; - } - - string result = string.FastAllocateString(s.Length); - - fixed (char* pSource = s) - { - fixed (char* pResult = result) - { -#if CORECLR - if (IsAsciiCasingSameAsInvariant && s.IsAscii()) - { - int length = s.Length; - char* a = pSource, b = pResult; - if (toUpper) - { - while (length-- != 0) - { - *b++ = ToUpperAsciiInvariant(*a++); - } - } - else - { - while (length-- != 0) - { - *b++ = ToLowerAsciiInvariant(*a++); - } - } - } - else -#endif - { - ChangeCase(pSource, s.Length, pResult, result.Length, toUpper); - } - } - } - - return result; - } - - internal unsafe void ChangeCase(ReadOnlySpan<char> source, Span<char> destination, bool toUpper) - { - Debug.Assert(!_invariantMode); - Debug.Assert(destination.Length >= source.Length); - - if (source.IsEmpty) - { - return; - } - - fixed (char* pSource = &MemoryMarshal.GetReference(source)) - { - fixed (char* pResult = &MemoryMarshal.GetReference(destination)) - { - if (IsAsciiCasingSameAsInvariant) - { - int length = 0; - char* a = pSource, b = pResult; - if (toUpper) - { - while (length < source.Length && *a < 0x80) - { - *b++ = ToUpperAsciiInvariant(*a++); - length++; - } - } - else - { - while (length < source.Length && *a < 0x80) - { - *b++ = ToLowerAsciiInvariant(*a++); - length++; - } - } - - if (length != source.Length) - { - ChangeCase(a, source.Length - length, b, destination.Length - length, toUpper); - } - } - else - { - ChangeCase(pSource, source.Length, pResult, destination.Length, toUpper); - } - } - } - } - - private unsafe char ChangeCase(char c, bool toUpper) - { - Debug.Assert(!_invariantMode); - - char dst = default(char); - - ChangeCase(&c, 1, &dst, 1, toUpper); - - return dst; - } + private void FinishInitialization() { } // ----------------------------- // ---- PAL layer ends here ---- |