Skip to content

Commit 77c7211

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 55356c9 commit 77c7211

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

vortex-buffer/src/bit/buf.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,9 @@ impl BitBuffer {
150150

151151
let chunks_count = len / 64;
152152
let remainder = len % 64;
153-
let mut chunks_iter = self.chunks().iter_padded();
153+
let chunks = self.chunks();
154154

155-
for chunk_idx in 0..chunks_count {
156-
let src_chunk = chunks_iter.next().unwrap_or(0);
155+
for (chunk_idx, src_chunk) in chunks.iter().enumerate() {
157156
let mut packed = 0u64;
158157
for bit_idx in 0..64 {
159158
let i = bit_idx + chunk_idx * 64;
@@ -166,7 +165,7 @@ impl BitBuffer {
166165
}
167166

168167
if remainder != 0 {
169-
let src_chunk = chunks_iter.next().unwrap_or(0);
168+
let src_chunk = chunks.remainder_bits();
170169
let mut packed = 0u64;
171170
for bit_idx in 0..remainder {
172171
let i = bit_idx + chunks_count * 64;

0 commit comments

Comments
 (0)