pub fn setValue(self: *Self, index: usize, value: bool) void
Changes the value of the specified bit of the bit set to match the passed boolean.
self: *Self
index: usize
value: bool
827 828 829 830 831 832 833
pub fn setValue(self: *Self, index: usize, value: bool) void { assert(index < self.bit_length); const bit = maskBit(index); const mask_index = maskIndex(index); const new_bit = bit & std.math.boolMask(MaskInt, value); self.masks[mask_index] = (self.masks[mask_index] & ~bit) | new_bit; }
Changes the value of the specified bit of the bit set to match the passed boolean.