internal XmlSortKey CreateSortKey(string s)
{
SortKey sortKey;
byte[] bytesKey;
if (UpperFirst)
{
// TODO: Support upper case first on Linux
// Issues #13926, #13236
throw new PlatformNotSupportedException(SR.Xslt_UpperCaseFirstNotSupported);
}
sortKey = Culture.CompareInfo.GetSortKey(s, _compops);
// Create an XmlStringSortKey using the SortKey if possible
#if DEBUG
// In debug-only code, test other code path more frequently
if (!UpperFirst && DescendingOrder)
return new XmlStringSortKey(sortKey, DescendingOrder);
#else
if (!UpperFirst)
return new XmlStringSortKey(sortKey, DescendingOrder);
#endif
// Get byte buffer from SortKey and modify it
bytesKey = sortKey.KeyData;
return new XmlStringSortKey(bytesKey, DescendingOrder);
}
}