push
Function parameters
Parameters
- self:*@This()
- b:u1
Functions in this namespace
Functions
- pushWithStateAssumeCapacity
- Standalone function for working with a fixed-size buffer.
- peekWithState
- Standalone function for working with a fixed-size buffer.
- popWithState
- Standalone function for working with a fixed-size buffer.
Source
Implementation
pub fn push(self: *@This(), b: u1) Allocator.Error!void {
const byte_index = self.bit_len >> 3;
if (self.bytes.items.len <= byte_index) {
try self.bytes.append(0);
}
pushWithStateAssumeCapacity(self.bytes.items, &self.bit_len, b);
}