Return the index of any bits within `new` not set in `existing`.
(existing: &[u64], new: &[u64])
| 88 | |
| 89 | /// Return the index of any bits within `new` not set in `existing`. |
| 90 | pub fn get_new_bits(existing: &[u64], new: &[u64]) -> Vec<u32> { |
| 91 | let mut new_bits = vec![]; |
| 92 | for (i, (&old, &new)) in existing.iter().zip(new).enumerate() { |
| 93 | if old | new == old { |
| 94 | continue; |
| 95 | } |
| 96 | |
| 97 | for j in 0..64 { |
| 98 | if ((old & (1 << j)) == 0) && ((new & (1 << j)) != 0) { |
| 99 | new_bits.push((i * 64 + j).try_into().unwrap()); |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | new_bits |
| 104 | } |
| 105 | |
| 106 | /// Or the bits from `new` with `old` returning the total number of bits set. |
| 107 | #[cold] |