@@ -9,9 +9,9 @@ public static int GenerateHashCode(this char[] array, int offset, int length)
99 {
1010 var hashSeed = 5381 ;
1111 var hashAccumulator = hashSeed ;
12- fixed ( char * src = & array [ offset ] )
12+ fixed ( char * pointer = & array [ offset ] )
1313 {
14- for ( char * s = src , last = s + length ; s < last ; s ++ )
14+ for ( char * s = pointer , last = s + length ; s < last ; s ++ )
1515 {
1616 hashAccumulator = ( hashAccumulator << 5 ) + hashAccumulator ^ * s ;
1717 }
@@ -24,54 +24,54 @@ public static int GenerateHashCode(this char[] array, int offset, int length)
2424 /// </remarks>
2525 public static bool ContentEqualTo ( this char [ ] left , int leftOffset , int length , char [ ] right , int rightOffset )
2626 {
27- fixed ( char * ap = & left [ leftOffset ] )
27+ fixed ( char * leftPointer = & left [ leftOffset ] )
2828 {
29- fixed ( char * bp = & right [ rightOffset ] )
29+ fixed ( char * rightPointer = & right [ rightOffset ] )
3030 {
31- char * a = ap , b = bp ;
32- if ( ! CheckArraysMainPartForEquality ( ref a , ref b , ref length ) )
31+ char * leftPointerCopy = leftPointer , rightPointerCopy = rightPointer ;
32+ if ( ! CheckArraysMainPartForEquality ( ref leftPointerCopy , ref rightPointerCopy , ref length ) )
3333 {
3434 return false ;
3535 }
36- CheckArraysRemainderForEquality ( ref a , ref b , ref length ) ;
36+ CheckArraysRemainderForEquality ( ref leftPointerCopy , ref rightPointerCopy , ref length ) ;
3737 return length <= 0 ;
3838 }
3939 }
4040 }
4141
42- private static bool CheckArraysMainPartForEquality ( ref char * a , ref char * b , ref int length )
42+ private static bool CheckArraysMainPartForEquality ( ref char * left , ref char * right , ref int length )
4343 {
4444 while ( length >= 10 )
4545 {
46- if ( ( * ( int * ) a != * ( int * ) b )
47- || ( * ( int * ) ( a + 2 ) != * ( int * ) ( b + 2 ) )
48- || ( * ( int * ) ( a + 4 ) != * ( int * ) ( b + 4 ) )
49- || ( * ( int * ) ( a + 6 ) != * ( int * ) ( b + 6 ) )
50- || ( * ( int * ) ( a + 8 ) != * ( int * ) ( b + 8 ) ) )
46+ if ( ( * ( int * ) left != * ( int * ) right )
47+ || ( * ( int * ) ( left + 2 ) != * ( int * ) ( right + 2 ) )
48+ || ( * ( int * ) ( left + 4 ) != * ( int * ) ( right + 4 ) )
49+ || ( * ( int * ) ( left + 6 ) != * ( int * ) ( right + 6 ) )
50+ || ( * ( int * ) ( left + 8 ) != * ( int * ) ( right + 8 ) ) )
5151 {
5252 return false;
5353 }
54- a += 10 ;
55- b += 10 ;
54+ left += 10 ;
55+ right += 10 ;
5656 length -= 10 ;
5757 }
5858 return true;
5959 }
6060
61- private static void CheckArraysRemainderForEquality ( ref char * a , ref char * b , ref int length )
61+ private static void CheckArraysRemainderForEquality ( ref char * left , ref char * right , ref int length )
6262 {
6363 // This depends on the fact that the String objects are
6464 // always zero terminated and that the terminating zero is not included
6565 // in the length. For odd string sizes, the last compare will include
6666 // the zero terminator.
6767 while ( length > 0 )
6868 {
69- if ( * ( int * ) a != * ( int * ) b )
69+ if ( * ( int * ) left != * ( int * ) right )
7070 {
7171 break ;
7272 }
73- a += 2 ;
74- b += 2 ;
73+ left += 2 ;
74+ right += 2 ;
7575 length -= 2 ;
7676 }
7777 }
0 commit comments