Skip to content

Commit

Permalink
chore: Window improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
amv-dev committed Mar 28, 2021
1 parent a55bac9 commit 7ac8fba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ where
{
type Output = T;

fn index(&self, mut index: PeriodType) -> &Self::Output {
fn index(&self, index: PeriodType) -> &Self::Output {
debug_assert!(index < self.size, "Window index {:} is out of range", index);

index = self.size - index - 1;
let index = self.s_1 - index;
let saturated = self.index.saturating_add(index);
let overflow = (saturated >= self.size) as PeriodType;
let s = self.size - self.index;
Expand Down

0 comments on commit 7ac8fba

Please sign in to comment.