Add vec!['\0'; n] optimization, like vec![0; n]
Similarly to vec![ptr::null{,_mut}(); n] in previous change, this adds the optimization for vec!['\0'; n].
This commit is contained in:
parent
cc939ac345
commit
0df837f792
1 changed files with 2 additions and 0 deletions
|
@ -1611,6 +1611,8 @@ impl_is_zero!(u64, |x| x == 0);
|
|||
impl_is_zero!(u128, |x| x == 0);
|
||||
impl_is_zero!(usize, |x| x == 0);
|
||||
|
||||
impl_is_zero!(char, |x| x == '\0');
|
||||
|
||||
impl_is_zero!(f32, |x: f32| x.to_bits() == 0);
|
||||
impl_is_zero!(f64, |x: f64| x.to_bits() == 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue