File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,20 @@ public static int Compare(string s1, string s2)
10
10
int marker1 = 0 ;
11
11
int marker2 = 0 ;
12
12
13
+ char [ ] tmp1 = new char [ len1 ] ;
14
+ char [ ] tmp2 = new char [ len2 ] ;
15
+
13
16
while ( marker1 < len1 && marker2 < len2 )
14
17
{
15
18
char c1 = s1 [ marker1 ] ;
16
19
char c2 = s2 [ marker2 ] ;
17
-
18
- char [ ] space1 = new char [ len1 ] ;
19
- char [ ] space2 = new char [ len2 ] ;
20
-
21
20
int loc1 = 0 ;
22
21
int loc2 = 0 ;
23
22
24
23
bool isDigit1 = char . IsDigit ( c1 ) ;
25
24
do
26
25
{
27
- space1 [ loc1 ] = c1 ;
26
+ tmp1 [ loc1 ] = c1 ;
28
27
loc1 ++ ;
29
28
marker1 ++ ;
30
29
@@ -37,7 +36,7 @@ public static int Compare(string s1, string s2)
37
36
bool isDigit2 = char . IsDigit ( c2 ) ;
38
37
do
39
38
{
40
- space2 [ loc2 ] = c2 ;
39
+ tmp2 [ loc2 ] = c2 ;
41
40
loc2 ++ ;
42
41
marker2 ++ ;
43
42
@@ -47,9 +46,8 @@ public static int Compare(string s1, string s2)
47
46
break ;
48
47
} while ( char . IsDigit ( c2 ) == isDigit2 ) ;
49
48
50
- string sub1 = new string ( space1 , 0 , loc1 ) ;
51
- string sub2 = new string ( space2 , 0 , loc2 ) ;
52
-
49
+ string sub1 = new string ( tmp1 , 0 , loc1 ) ;
50
+ string sub2 = new string ( tmp2 , 0 , loc2 ) ;
53
51
int result ;
54
52
if ( isDigit1 && isDigit2 )
55
53
{
You can’t perform that action at this time.
0 commit comments