Rollup merge of #58628 - RReverser:optimise-vec-false, r=oli-obk
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:
commit
93bfa92a3d
1 changed files with 1 additions and 0 deletions
|
@ -1610,6 +1610,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