We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1ecee9 commit 8295c50Copy full SHA for 8295c50
src/libstd/memchr.rs
@@ -209,7 +209,7 @@ mod fallback {
209
let end_align = (ptr as usize + len) & (usize_bytes - 1);
210
let mut offset;
211
if end_align > 0 {
212
- offset = len - cmp::min(end_align, len);
+ offset = if end_align >= len { 0 } else { len - end_align };
213
if let Some(index) = text[offset..].iter().rposition(|elt| *elt == x) {
214
return Some(offset + index);
215
}
0 commit comments