@@ -22,7 +22,7 @@ private void InitSort(CultureInfo culture)
22
22
{
23
23
_sortName = culture . SortName ;
24
24
25
- if ( _invariantMode )
25
+ if ( GlobalizationMode . Invariant )
26
26
{
27
27
_isAsciiEqualityOrdinal = true ;
28
28
}
@@ -210,7 +210,7 @@ private static unsafe int CompareStringOrdinalIgnoreCase(ref char string1, int c
210
210
// that takes two spans. But due to this issue, that's adding significant overhead.
211
211
private unsafe int CompareString ( ReadOnlySpan < char > string1 , string string2 , CompareOptions options )
212
212
{
213
- Debug . Assert ( ! _invariantMode ) ;
213
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
214
214
Debug . Assert ( string2 != null ) ;
215
215
Debug . Assert ( ( options & ( CompareOptions . Ordinal | CompareOptions . OrdinalIgnoreCase ) ) == 0 ) ;
216
216
@@ -223,7 +223,7 @@ private unsafe int CompareString(ReadOnlySpan<char> string1, string string2, Com
223
223
224
224
private unsafe int CompareString ( ReadOnlySpan < char > string1 , ReadOnlySpan < char > string2 , CompareOptions options )
225
225
{
226
- Debug . Assert ( ! _invariantMode ) ;
226
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
227
227
Debug . Assert ( ( options & ( CompareOptions . Ordinal | CompareOptions . OrdinalIgnoreCase ) ) == 0 ) ;
228
228
229
229
fixed ( char * pString1 = & MemoryMarshal . GetReference ( string1 ) )
@@ -235,7 +235,7 @@ private unsafe int CompareString(ReadOnlySpan<char> string1, ReadOnlySpan<char>
235
235
236
236
internal unsafe int IndexOfCore ( string source , string target , int startIndex , int count , CompareOptions options , int * matchLengthPtr )
237
237
{
238
- Debug . Assert ( ! _invariantMode ) ;
238
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
239
239
240
240
Debug . Assert ( ! string . IsNullOrEmpty ( source ) ) ;
241
241
Debug . Assert ( target != null ) ;
@@ -286,7 +286,7 @@ internal unsafe int IndexOfCore(string source, string target, int startIndex, in
286
286
// For now, this method is only called from Span APIs with either options == CompareOptions.None or CompareOptions.IgnoreCase
287
287
internal unsafe int IndexOfCore ( ReadOnlySpan < char > source , ReadOnlySpan < char > target , CompareOptions options , int * matchLengthPtr , bool fromBeginning )
288
288
{
289
- Debug . Assert ( ! _invariantMode ) ;
289
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
290
290
Debug . Assert ( source . Length != 0 ) ;
291
291
Debug . Assert ( target . Length != 0 ) ;
292
292
@@ -317,7 +317,7 @@ internal unsafe int IndexOfCore(ReadOnlySpan<char> source, ReadOnlySpan<char> ta
317
317
/// <returns></returns>
318
318
private unsafe int IndexOfOrdinalIgnoreCaseHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > target , CompareOptions options , int * matchLengthPtr , bool fromBeginning )
319
319
{
320
- Debug . Assert ( ! _invariantMode ) ;
320
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
321
321
322
322
Debug . Assert ( ! source . IsEmpty ) ;
323
323
Debug . Assert ( ! target . IsEmpty ) ;
@@ -403,7 +403,7 @@ private unsafe int IndexOfOrdinalIgnoreCaseHelper(ReadOnlySpan<char> source, Rea
403
403
404
404
private unsafe int IndexOfOrdinalHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > target , CompareOptions options , int * matchLengthPtr , bool fromBeginning )
405
405
{
406
- Debug . Assert ( ! _invariantMode ) ;
406
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
407
407
408
408
Debug . Assert ( ! source . IsEmpty ) ;
409
409
Debug . Assert ( ! target . IsEmpty ) ;
@@ -478,7 +478,7 @@ private unsafe int IndexOfOrdinalHelper(ReadOnlySpan<char> source, ReadOnlySpan<
478
478
479
479
private unsafe int LastIndexOfCore ( string source , string target , int startIndex , int count , CompareOptions options )
480
480
{
481
- Debug . Assert ( ! _invariantMode ) ;
481
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
482
482
483
483
Debug . Assert ( ! string . IsNullOrEmpty ( source ) ) ;
484
484
Debug . Assert ( target != null ) ;
@@ -516,7 +516,7 @@ private unsafe int LastIndexOfCore(string source, string target, int startIndex,
516
516
517
517
private bool StartsWith ( string source , string prefix , CompareOptions options )
518
518
{
519
- Debug . Assert ( ! _invariantMode ) ;
519
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
520
520
521
521
Debug . Assert ( ! string . IsNullOrEmpty ( source ) ) ;
522
522
Debug . Assert ( ! string . IsNullOrEmpty ( prefix ) ) ;
@@ -534,7 +534,7 @@ private bool StartsWith(string source, string prefix, CompareOptions options)
534
534
535
535
private unsafe bool StartsWith ( ReadOnlySpan < char > source , ReadOnlySpan < char > prefix , CompareOptions options )
536
536
{
537
- Debug . Assert ( ! _invariantMode ) ;
537
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
538
538
539
539
Debug . Assert ( ! source . IsEmpty ) ;
540
540
Debug . Assert ( ! prefix . IsEmpty ) ;
@@ -568,7 +568,7 @@ private unsafe bool StartsWith(ReadOnlySpan<char> source, ReadOnlySpan<char> pre
568
568
569
569
private unsafe bool StartsWithOrdinalIgnoreCaseHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > prefix , CompareOptions options )
570
570
{
571
- Debug . Assert ( ! _invariantMode ) ;
571
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
572
572
573
573
Debug . Assert ( ! source . IsEmpty ) ;
574
574
Debug . Assert ( ! prefix . IsEmpty ) ;
@@ -614,7 +614,7 @@ private unsafe bool StartsWithOrdinalIgnoreCaseHelper(ReadOnlySpan<char> source,
614
614
615
615
private unsafe bool StartsWithOrdinalHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > prefix , CompareOptions options )
616
616
{
617
- Debug . Assert ( ! _invariantMode ) ;
617
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
618
618
619
619
Debug . Assert ( ! source . IsEmpty ) ;
620
620
Debug . Assert ( ! prefix . IsEmpty ) ;
@@ -649,7 +649,7 @@ private unsafe bool StartsWithOrdinalHelper(ReadOnlySpan<char> source, ReadOnlyS
649
649
650
650
private bool EndsWith ( string source , string suffix , CompareOptions options )
651
651
{
652
- Debug . Assert ( ! _invariantMode ) ;
652
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
653
653
654
654
Debug . Assert ( ! string . IsNullOrEmpty ( source ) ) ;
655
655
Debug . Assert ( ! string . IsNullOrEmpty ( suffix ) ) ;
@@ -667,7 +667,7 @@ private bool EndsWith(string source, string suffix, CompareOptions options)
667
667
668
668
private unsafe bool EndsWith ( ReadOnlySpan < char > source , ReadOnlySpan < char > suffix , CompareOptions options )
669
669
{
670
- Debug . Assert ( ! _invariantMode ) ;
670
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
671
671
672
672
Debug . Assert ( ! source . IsEmpty ) ;
673
673
Debug . Assert ( ! suffix . IsEmpty ) ;
@@ -701,7 +701,7 @@ private unsafe bool EndsWith(ReadOnlySpan<char> source, ReadOnlySpan<char> suffi
701
701
702
702
private unsafe bool EndsWithOrdinalIgnoreCaseHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > suffix , CompareOptions options )
703
703
{
704
- Debug . Assert ( ! _invariantMode ) ;
704
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
705
705
706
706
Debug . Assert ( ! source . IsEmpty ) ;
707
707
Debug . Assert ( ! suffix . IsEmpty ) ;
@@ -747,7 +747,7 @@ private unsafe bool EndsWithOrdinalIgnoreCaseHelper(ReadOnlySpan<char> source, R
747
747
748
748
private unsafe bool EndsWithOrdinalHelper ( ReadOnlySpan < char > source , ReadOnlySpan < char > suffix , CompareOptions options )
749
749
{
750
- Debug . Assert ( ! _invariantMode ) ;
750
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
751
751
752
752
Debug . Assert ( ! source . IsEmpty ) ;
753
753
Debug . Assert ( ! suffix . IsEmpty ) ;
@@ -782,7 +782,7 @@ private unsafe bool EndsWithOrdinalHelper(ReadOnlySpan<char> source, ReadOnlySpa
782
782
783
783
private unsafe SortKey CreateSortKey ( string source , CompareOptions options )
784
784
{
785
- Debug . Assert ( ! _invariantMode ) ;
785
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
786
786
787
787
if ( source == null ) { throw new ArgumentNullException ( nameof ( source ) ) ; }
788
788
@@ -861,7 +861,7 @@ private static unsafe bool IsSortable(char *text, int length)
861
861
862
862
internal unsafe int GetHashCodeOfStringCore ( ReadOnlySpan < char > source , CompareOptions options )
863
863
{
864
- Debug . Assert ( ! _invariantMode ) ;
864
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
865
865
Debug . Assert ( ( options & ( CompareOptions . Ordinal | CompareOptions . OrdinalIgnoreCase ) ) == 0 ) ;
866
866
867
867
if ( source . Length == 0 )
@@ -932,7 +932,7 @@ private static byte[] GetNullTerminatedUtf8String(string s)
932
932
933
933
private SortVersion GetSortVersion ( )
934
934
{
935
- Debug . Assert ( ! _invariantMode ) ;
935
+ Debug . Assert ( ! GlobalizationMode . Invariant ) ;
936
936
937
937
int sortVersion = Interop . Globalization . GetSortVersion ( _sortHandle ) ;
938
938
return new SortVersion ( sortVersion , LCID , new Guid ( sortVersion , 0 , 0 , 0 , 0 , 0 , 0 ,
0 commit comments