Prioritize last piece. Dont ask me why :)

This commit is contained in:
Igor Katson 2021-10-16 13:18:25 +01:00
parent 6bd518676d
commit 5de63af783
3 changed files with 17 additions and 2 deletions

View file

@ -118,6 +118,9 @@ impl Lengths {
pub const fn total_chunks(&self) -> u32 {
ceil_div_u64(self.total_length, self.chunk_length as u64) as u32
}
pub const fn last_piece_id(&self) -> ValidPieceIndex {
ValidPieceIndex(self.last_piece_id)
}
pub const fn total_pieces(&self) -> u32 {
self.last_piece_id + 1
}