1
Fork 0

Optimise vec![false; N] to zero-alloc

Nowadays booleans have a well-defined representation, so there is no reason not to optimise their allocation.
This commit is contained in:
Ingvar Stepanyan 2019-02-21 23:02:34 +00:00
parent 1349c84a4f
commit 9f58c5fa7c

View file

@ -1606,6 +1606,7 @@ impl_is_zero!(u64, |x| x == 0);
impl_is_zero!(u128, |x| x == 0);
impl_is_zero!(usize, |x| x == 0);
impl_is_zero!(bool, |x| x == false);
impl_is_zero!(char, |x| x == '\0');
impl_is_zero!(f32, |x: f32| x.to_bits() == 0);