We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac48e62 commit a5d0c2cCopy full SHA for a5d0c2c
library/std/src/sys/windows/mod.rs
@@ -99,11 +99,10 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
99
100
pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option<usize> {
101
let ptr = haystack.as_ptr();
102
- let mut len = haystack.len();
103
let mut start = &haystack[..];
104
105
// For performance reasons unfold the loop eight times.
106
- while len >= 8 {
+ while start.len() >= 8 {
107
if start[0] == needle {
108
return Some((start.as_ptr() as usize - ptr as usize) / 2);
109
}
@@ -130,7 +129,6 @@ pub fn unrolled_find_u16s(needle: u16, haystack: &[u16]) -> Option<usize> {
130
129
131
132
start = &start[8..];
133
- len -= 8;
134
135
136
for (i, c) in start.iter().enumerate() {
0 commit comments