File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
library/std/src/sys/windows Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,10 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
9999
100100pub fn unrolled_find_u16s ( needle : u16 , haystack : & [ u16 ] ) -> Option < usize > {
101101 let ptr = haystack. as_ptr ( ) ;
102- let mut len = haystack. len ( ) ;
103102 let mut start = & haystack[ ..] ;
104103
105104 // For performance reasons unfold the loop eight times.
106- while len >= 8 {
105+ while start . len ( ) >= 8 {
107106 if start[ 0 ] == needle {
108107 return Some ( ( start. as_ptr ( ) as usize - ptr as usize ) / 2 ) ;
109108 }
@@ -130,7 +129,6 @@ pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option<usize> {
130129 }
131130
132131 start = & start[ 8 ..] ;
133- len -= 8 ;
134132 }
135133
136134 for ( i, c) in start. iter ( ) . enumerate ( ) {
You can’t perform that action at this time.
0 commit comments