@@ -63,26 +63,26 @@ public int Compare(ReadOnlyMemory<char> x, ReadOnlyMemory<char> y)
6363
6464 public static int Compare ( ReadOnlySpan < char > x , ReadOnlySpan < char > y , StringComparison stringComparison )
6565 {
66- // Handle file extensions specially
67- int xExtPos = GetExtensionPosition ( x ) ;
68- int yExtPos = GetExtensionPosition ( y ) ;
69-
70- // If both have extensions, compare the names first
71- if ( xExtPos >= 0 && yExtPos >= 0 )
72- {
73- var xName = x . Slice ( 0 , xExtPos ) ;
74- var yName = y . Slice ( 0 , yExtPos ) ;
75-
76- int nameCompare = CompareWithoutExtension ( xName , yName , stringComparison ) ;
77- if ( nameCompare != 0 )
78- return nameCompare ;
79-
80- // If names match, compare extensions
81- return x . Slice ( xExtPos ) . CompareTo ( y . Slice ( yExtPos ) , stringComparison ) ;
82- }
83-
84- // Original comparison logic for non-extension cases
85- return CompareWithoutExtension ( x , y , stringComparison ) ;
66+ // Handle file extensions specially
67+ int xExtPos = GetExtensionPosition ( x ) ;
68+ int yExtPos = GetExtensionPosition ( y ) ;
69+
70+ // If both have extensions, compare the names first
71+ if ( xExtPos >= 0 && yExtPos >= 0 )
72+ {
73+ var xName = x . Slice ( 0 , xExtPos ) ;
74+ var yName = y . Slice ( 0 , yExtPos ) ;
75+
76+ int nameCompare = CompareWithoutExtension ( xName , yName , stringComparison ) ;
77+ if ( nameCompare != 0 )
78+ return nameCompare ;
79+
80+ // If names match, compare extensions
81+ return x . Slice ( xExtPos ) . CompareTo ( y . Slice ( yExtPos ) , stringComparison ) ;
82+ }
83+
84+ // Original comparison logic for non-extension cases
85+ return CompareWithoutExtension ( x , y , stringComparison ) ;
8686 }
8787
8888 private static int CompareWithoutExtension ( ReadOnlySpan < char > x , ReadOnlySpan < char > y , StringComparison stringComparison )
0 commit comments