Trying to check / simplify / improve math

This commit is contained in:
Igor Katson 2024-03-30 12:33:11 +00:00
parent c5b21992e6
commit 3e2fac81b1
3 changed files with 61 additions and 73 deletions

View file

@ -43,7 +43,7 @@ fn compute_chunk_status(lengths: &Lengths, needed_pieces: &BF) -> anyhow::Result
.with_context(|| format!("error getting range {range:?} from needed_pieces"))?
.iter_zeros()
{
let offset = piece_index * lengths.default_max_chunks_per_piece() as usize;
let offset = piece_index * lengths.default_chunks_per_piece() as usize;
let chunks_per_piece = lengths
.chunks_per_piece(lengths.try_validate_piece_index(piece_index as u32)?)
as usize;