Sets the bit at 'bit_index' to v.
| 57 | |
| 58 | /// Sets the bit at 'bit_index' to v. |
| 59 | void Set(int64_t bit_index, bool v) { |
| 60 | int64_t word_index = bit_index >> NUM_OFFSET_BITS; |
| 61 | bit_index &= BIT_INDEX_MASK; |
| 62 | DCHECK_LT(word_index, buffer_.size()); |
| 63 | if (v) { |
| 64 | buffer_[word_index] |= (1LL << bit_index); |
| 65 | } else { |
| 66 | buffer_[word_index] &= ~(1LL << bit_index); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /// Returns true if the bit at 'bit_index' is set. |
| 71 | bool Get(int64_t bit_index) const { |