Fixed bugs
This commit is contained in:
parent
87d6fe27ce
commit
0a640daba4
3 changed files with 88 additions and 67 deletions
|
|
@ -113,6 +113,9 @@ impl Lengths {
|
|||
}
|
||||
self.piece_length
|
||||
}
|
||||
pub const fn chunk_absolute_offset(&self, chunk_info: &ChunkInfo) -> u64 {
|
||||
self.piece_offset(chunk_info.piece_index) + chunk_info.offset as u64
|
||||
}
|
||||
pub const fn piece_offset(&self, index: ValidPieceIndex) -> u64 {
|
||||
index.0 as u64 * self.piece_length as u64
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue