mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
Removing if so it's more like the previous implementation.
This commit is contained in:
parent
328abfb943
commit
425a70a460
@ -49,9 +49,7 @@ impl<'a> Iterator for Chars<'a> {
|
||||
// length in `char` is equal to the number of non-continuation bytes
|
||||
let mut char_count = 0;
|
||||
for &byte in self.iter {
|
||||
if !utf8_is_cont_byte(byte) {
|
||||
char_count += 1;
|
||||
}
|
||||
char_count += !utf8_is_cont_byte(byte) as usize;
|
||||
}
|
||||
char_count
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user