Skip to content

Commit

Permalink
Fix next source piece index calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Dec 9, 2024
1 parent 9bc35f4 commit 436f462
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/subspace-core-primitives/src/pieces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl PieceIndex {
/// Returns the next source piece index
#[inline]
pub const fn next_source_index(&self) -> PieceIndex {
PieceIndex(self.0.next_multiple_of(Self::source_ratio()))
PieceIndex(self.0 + Self::source_ratio() - (self.0 % Self::source_ratio()))
}

/// The ratio of source pieces to all pieces
Expand Down

0 comments on commit 436f462

Please sign in to comment.