mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-29 18:21:43 +00:00
Fix over-allocation of memory for dense U section of matrix
The previous code had an off by one error leading to an extra word being allocated for each row
This commit is contained in:
parent
3a4068a726
commit
6245ab1c9a
@ -262,7 +262,7 @@ impl BinaryMatrix for SparseBinaryMatrix {
|
||||
);
|
||||
assert_eq!(self.column_index_disabled, false);
|
||||
self.num_dense_columns += 1;
|
||||
let (last_word, last_bit) = self.bit_position(self.height, self.num_dense_columns - 1);
|
||||
let (last_word, last_bit) = self.bit_position(self.height - 1, self.num_dense_columns - 1);
|
||||
// If this is in a new word
|
||||
if last_bit == 0 && last_word >= self.dense_elements.len() {
|
||||
// Append a new set of words
|
||||
|
Loading…
Reference in New Issue
Block a user