Imported Upstream version 6.0.0.241

Former-commit-id: 6bb91ae3d8008b2e06beaf4212ad32102b270e2a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-05-13 08:34:00 +00:00
parent 2bc8cfd5d0
commit 1efc83b696
61 changed files with 248 additions and 100 deletions

View File

@ -252,20 +252,18 @@ namespace System.Globalization
if (source.IsEmpty)
return;
var ti = CultureInfo.CurrentCulture.TextInfo;
fixed (char* pSource = &MemoryMarshal.GetReference (source))
fixed (char* pResult = &MemoryMarshal.GetReference (destination)) {
int length = 0;
char* a = pSource, b = pResult;
if (toUpper) {
while (length < source.Length) {
*b++ = ti.ToUpper (*a++);
*b++ = this.ToUpper (*a++);
length++;
}
} else {
while (length < source.Length) {
*b++ = ti.ToLower (*a++);
*b++ = this.ToLower (*a++);
length++;
}
}