Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mcroomp committed Dec 17, 2024
1 parent da9adbd commit d60b37e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/structs/vpx_bool_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ impl<W: Write> VPXBoolWriter<W> {
self.carry();
}

// Append six bytes at a time to the buffer. Faster to add all
// 8 and then shrink the buffer than add 6 that creates a temporary buffer.
// Append six bytes at a time to the buffer.
if needs_to_grow(&self.buffer, 8) {
// avoid inlining slow path to allocate more memory that happens almost never
put_6bytes(&mut self.buffer, v_aligned);
} else {
// Faster to add all 8 and then shrink the buffer than add 6 that creates a temporary buffer.
let b = v_aligned.to_be_bytes();
self.buffer.extend_from_slice(&b);
self.buffer.truncate(self.buffer.len() - 2);
Expand Down

0 comments on commit d60b37e

Please sign in to comment.