Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions library/core/src/str/lossy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,7 @@ impl<'a> Iterator for Utf8Chunks<'a> {

let mut i = 0;
let mut valid_up_to = 0;
while i < self.source.len() {
// SAFETY: `i < self.source.len()` per previous line.
// For some reason the following are both significantly slower:
// while let Some(&byte) = self.source.get(i) {
// while let Some(byte) = self.source.get(i).copied() {
let byte = unsafe { *self.source.get_unchecked(i) };
while let Some(byte) = self.source.get(i).copied() {
i += 1;

if byte < 128 {
Expand Down
Loading