You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@ -88,14 +88,46 @@ namespace System.Globalization
|
||||
return internal_index_switch (source, startIndex, count, target, options, true);
|
||||
}
|
||||
|
||||
unsafe int IndexOfCore (ReadOnlySpan<char> source, ReadOnlySpan<char> target, CompareOptions options, int* matchLengthPtr)
|
||||
{
|
||||
// TODO: optimize
|
||||
|
||||
var s = new string (source);
|
||||
var t = new string (target);
|
||||
|
||||
return IndexOfCore (s, t, 0, s.Length, options, matchLengthPtr);
|
||||
}
|
||||
|
||||
int IndexOfOrdinalCore (ReadOnlySpan<char> source, ReadOnlySpan<char> value, bool ignoreCase)
|
||||
{
|
||||
// TODO: optimize
|
||||
|
||||
var s = new string (source);
|
||||
var v = new string (value);
|
||||
|
||||
if (!ignoreCase)
|
||||
return s.IndexOfUnchecked (v, 0, s.Length);
|
||||
|
||||
return s.IndexOfUncheckedIgnoreCase (v, 0, s.Length);
|
||||
}
|
||||
|
||||
int CompareString (ReadOnlySpan<char> string1, string string2, CompareOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// TODO: optimize
|
||||
|
||||
var s1 = new string (string1);
|
||||
|
||||
return internal_compare_switch (s1, 0, s1.Length, string2, 0, string2.Length, options);
|
||||
}
|
||||
|
||||
int CompareString (ReadOnlySpan<char> string1, ReadOnlySpan<char> string2, CompareOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
// TODO: optimize
|
||||
|
||||
var s1 = new string (string1);
|
||||
var s2 = new string (string2);
|
||||
|
||||
return internal_compare_switch (s1, 0, s1.Length, new string (s2), 0, s2.Length, options);
|
||||
}
|
||||
|
||||
unsafe static bool IsSortable (char *text, int length)
|
||||
@ -125,6 +157,12 @@ namespace System.Globalization
|
||||
return Compare (source, 0, prefix.Length, prefix, 0, prefix.Length, options) == 0;
|
||||
}
|
||||
|
||||
bool StartsWith (ReadOnlySpan<char> source, ReadOnlySpan<char> prefix, CompareOptions options)
|
||||
{
|
||||
// TODO: optimize
|
||||
return StartsWith (new string (source), new string (prefix), options);
|
||||
}
|
||||
|
||||
bool EndsWith (string source, string suffix, CompareOptions options)
|
||||
{
|
||||
if (UseManagedCollation)
|
||||
@ -136,6 +174,12 @@ namespace System.Globalization
|
||||
return Compare (source, source.Length - suffix.Length, suffix.Length, suffix, 0, suffix.Length, options) == 0;
|
||||
}
|
||||
|
||||
bool EndsWith (ReadOnlySpan<char> source, ReadOnlySpan<char> suffix, CompareOptions options)
|
||||
{
|
||||
// TODO: optimize
|
||||
return EndsWith (new string (source), new string (suffix), options);
|
||||
}
|
||||
|
||||
internal int GetHashCodeOfStringCore (string source, CompareOptions options)
|
||||
{
|
||||
return GetSortKey (source, options).GetHashCode ();
|
||||
|
Reference in New Issue
Block a user