Skip to content

Commit

Permalink
fix: Increment first_index correctly in inc_first_index (#944)
Browse files Browse the repository at this point in the history
This was not resulting in any reproducable issue, because `inc_last_index`
and `inc_first_index` are always called together. However, this could
lead to issues in future code changes.
  • Loading branch information
vadorovsky authored Jul 3, 2024
1 parent ddb97c8 commit 9c52b46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion merkle-tree/bounded-vec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ where
#[inline]
fn inc_first_index(&self) {
unsafe {
(*self.metadata).first_index = ((*self.metadata).last_index + 1) % self.capacity();
(*self.metadata).first_index = ((*self.metadata).first_index + 1) % self.capacity();
}
}

Expand Down

0 comments on commit 9c52b46

Please sign in to comment.