File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments