mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-27 09:19:02 +00:00
Fix some Clippy warnings
This commit is contained in:
parent
8b669faefd
commit
5a851083ed
@ -76,10 +76,8 @@ impl Decoder {
|
||||
}
|
||||
|
||||
let mut result = vec![];
|
||||
for block in self.blocks.iter() {
|
||||
if let Some(block) = block {
|
||||
result.extend(block);
|
||||
}
|
||||
for block in self.blocks.iter().flatten() {
|
||||
result.extend(block);
|
||||
}
|
||||
|
||||
result.truncate(self.config.transfer_length() as usize);
|
||||
@ -102,10 +100,8 @@ impl Decoder {
|
||||
}
|
||||
|
||||
let mut result = vec![];
|
||||
for block in self.blocks.iter() {
|
||||
if let Some(block) = block {
|
||||
result.extend(block);
|
||||
}
|
||||
for block in self.blocks.iter().flatten() {
|
||||
result.extend(block);
|
||||
}
|
||||
result.truncate(self.config.transfer_length() as usize);
|
||||
Some(result)
|
||||
|
@ -1189,14 +1189,13 @@ impl<T: BinaryMatrix> IntermediateSymbolDecoder<T> {
|
||||
}
|
||||
|
||||
fn record_fma_rows(&mut self, i: usize, iprime: usize, beta: Octet) {
|
||||
self.debug_symbol_add_ops += 1;
|
||||
if beta == Octet::one() {
|
||||
self.debug_symbol_add_ops += 1;
|
||||
self.deferred_D_ops.push(SymbolOps::AddAssign {
|
||||
dest: self.d[iprime],
|
||||
src: self.d[i],
|
||||
});
|
||||
} else {
|
||||
self.debug_symbol_add_ops += 1;
|
||||
self.debug_symbol_mul_ops += 1;
|
||||
self.deferred_D_ops.push(SymbolOps::FMA {
|
||||
dest: self.d[iprime],
|
||||
@ -1312,7 +1311,7 @@ impl<T: BinaryMatrix> IntermediateSymbolDecoder<T> {
|
||||
reorder.push(*i);
|
||||
}
|
||||
|
||||
let mut operation_vector = std::mem::replace(&mut self.deferred_D_ops, vec![]);
|
||||
let mut operation_vector = std::mem::take(&mut self.deferred_D_ops);
|
||||
operation_vector.push(SymbolOps::Reorder { order: reorder });
|
||||
return (Some(result), Some(operation_vector));
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ impl BinaryMatrix for SparseBinaryMatrix {
|
||||
}
|
||||
|
||||
fn get_ones_in_column(&self, col: usize, start_row: usize, end_row: usize) -> Vec<u32> {
|
||||
assert_eq!(self.column_index_disabled, false);
|
||||
assert!(!self.column_index_disabled);
|
||||
#[cfg(debug_assertions)]
|
||||
debug_assert!(self.debug_indexed_column_valid[col]);
|
||||
let physical_col = self.logical_col_to_physical[col];
|
||||
@ -321,7 +321,7 @@ impl BinaryMatrix for SparseBinaryMatrix {
|
||||
i,
|
||||
"Can only freeze the last sparse column"
|
||||
);
|
||||
assert_eq!(self.column_index_disabled, false);
|
||||
assert!(!self.column_index_disabled);
|
||||
self.num_dense_columns += 1;
|
||||
let (last_word, _) = self.bit_position(self.height - 1, self.num_dense_columns - 1);
|
||||
// If this is in a new word
|
||||
|
Loading…
Reference in New Issue
Block a user