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 {
99
99
100
100
pub fn unrolled_find_u16s ( needle : u16 , haystack : & [ u16 ] ) -> Option < usize > {
101
101
let ptr = haystack. as_ptr ( ) ;
102
- let mut len = haystack. len ( ) ;
103
102
let mut start = & haystack[ ..] ;
104
103
105
104
// For performance reasons unfold the loop eight times.
106
- while len >= 8 {
105
+ while start . len ( ) >= 8 {
107
106
if start[ 0 ] == needle {
108
107
return Some ( ( start. as_ptr ( ) as usize - ptr as usize ) / 2 ) ;
109
108
}
@@ -130,7 +129,6 @@ pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option<usize> {
130
129
}
131
130
132
131
start = & start[ 8 ..] ;
133
- len -= 8 ;
134
132
}
135
133
136
134
for ( i, c) in start. iter ( ) . enumerate ( ) {
You can’t perform that action at this time.
0 commit comments