Skip to content

Commit a5d0c2c

Browse files
committed
Remove redundant len binding
1 parent ac48e62 commit a5d0c2c

File tree

1 file changed

+1
-3
lines changed
  • library/std/src/sys/windows

1 file changed

+1
-3
lines changed

library/std/src/sys/windows/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,10 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
9999

100100
pub 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() {

0 commit comments

Comments
 (0)