From f98fbbf298a5e899ea0dd4ab5a12e5cf688bb4f3 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 28 Jun 2024 19:49:23 +0800 Subject: [PATCH] Revert "Ensure minimum doesn't exceed maximum" This reverts commit 37ce4e842601dc4198556c6157d0ddb61dfbe39c. Also remove a stale comment that is no longer relevant after b8ec76fb66320de4321389e764fff1e1c88a8150 --- rslib/src/scheduler/states/fuzz.rs | 1 - rslib/src/scheduler/states/relearning.rs | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/rslib/src/scheduler/states/fuzz.rs b/rslib/src/scheduler/states/fuzz.rs index 5247a6269..bb5a15e54 100644 --- a/rslib/src/scheduler/states/fuzz.rs +++ b/rslib/src/scheduler/states/fuzz.rs @@ -33,7 +33,6 @@ static FUZZ_RANGES: [FuzzRange; 3] = [ impl<'a> StateContext<'a> { /// Apply fuzz, respecting the passed bounds. - /// Caller must ensure reasonable bounds. pub(crate) fn with_review_fuzz(&self, interval: f32, minimum: u32, maximum: u32) -> u32 { with_review_fuzz(self.fuzz_factor, interval, minimum, maximum) } diff --git a/rslib/src/scheduler/states/relearning.rs b/rslib/src/scheduler/states/relearning.rs index d67a5ef90..5972a6f39 100644 --- a/rslib/src/scheduler/states/relearning.rs +++ b/rslib/src/scheduler/states/relearning.rs @@ -135,11 +135,8 @@ impl RelearnState { fn answer_easy(self, ctx: &StateContext) -> ReviewState { let scheduled_days = if let Some(states) = &ctx.fsrs_next_states { let (mut minimum, maximum) = ctx.min_and_max_review_intervals(1); - // ensure 1 greater than good where possible let good = ctx.with_review_fuzz(states.good.interval as f32, minimum, maximum); - if minimum < maximum { - minimum = good + 1; - } + minimum = good + 1; let interval = states.easy.interval; ctx.with_review_fuzz(interval as f32, minimum, maximum) } else {