Gets the i-th bit from a byte. Should only be used with i <= 7.
| 173 | |
| 174 | // Gets the i-th bit from a byte. Should only be used with i <= 7. |
| 175 | static constexpr bool GetBitFromByte(uint8_t byte, uint8_t i) { |
| 176 | return byte & kBitmask[i]; |
| 177 | } |
| 178 | |
| 179 | static inline void ClearBit(uint8_t* bits, int64_t i) { |
| 180 | bits[i / 8] &= kFlippedBitmask[i % 8]; |