1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

enable alligned string optimization

This commit is contained in:
Robin Appelman 2020-01-06 19:14:38 +01:00
commit ce93ded2f2

View file

@ -427,7 +427,7 @@ where
#[inline] #[inline]
fn read_string_bytes(&self, position: usize) -> Result<Vec<u8>> { fn read_string_bytes(&self, position: usize) -> Result<Vec<u8>> {
let shift = position & 7; let shift = position & 7;
if false && shift == 0 { if shift == 0 {
let byte_index = position / 8; let byte_index = position / 8;
Ok(self.bytes[byte_index..self.find_null_byte(byte_index)].to_vec()) Ok(self.bytes[byte_index..self.find_null_byte(byte_index)].to_vec())
} else { } else {
@ -564,7 +564,7 @@ impl<E: Endianness> Debug for BitBuffer<E> {
} }
} }
/// Return `true` if `x` contains any zero byte. /// Return `true` if `x` contains any zero byte except for the topmost byte.
/// ///
/// From *Matters Computational*, J. Arndt /// From *Matters Computational*, J. Arndt
/// ///