Same instructions, but simpler.
This commit is contained in:
parent
c07e5585b3
commit
a623ea5301
1 changed files with 1 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ impl<'a> Iterator for Chars<'a> {
|
|||
#[inline]
|
||||
fn count(self) -> usize {
|
||||
// length in `char` is equal to the number of non-continuation bytes
|
||||
self.iter.map(|&byte| !utf8_is_cont_byte(byte) as usize).sum()
|
||||
self.iter.filter(|&&byte| !utf8_is_cont_byte(byte)).count()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue