mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
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:
@@ -1611,6 +1611,8 @@ fn is_zero(&self) -> bool {
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user