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:
parent
1349c84a4f
commit
9f58c5fa7c
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue