Apply fuzz to SM2 lapse interval and respect max ivl (#3275)

* Apply fuzz to SM2 lapse interval and respect max ivl

Imo, there is no reason for not applying fuzz to SM2 lapse intervals

* Update review.rs

* Format

* Update review.rs

* Update review.rs

* Update review.rs

* Update review.rs
This commit is contained in:
user1823 2024-07-10 18:58:21 +05:30 committed by GitHub
parent 88b506413f
commit 6ec22e5118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,11 +77,16 @@ impl ReviewState {
ctx: &StateContext,
) -> (u32, Option<FsrsMemoryState>) {
if let Some(states) = &ctx.fsrs_next_states {
// In FSRS, fuzz is applied when the card leaves the relearning
// stage
(states.again.interval, Some(states.again.memory.into()))
} else {
let interval = (((self.scheduled_days as f32) * ctx.lapse_multiplier) as u32)
.max(ctx.minimum_lapse_interval)
.max(1);
let (minimum, maximum) = ctx.min_and_max_review_intervals(ctx.minimum_lapse_interval);
let interval = ctx.with_review_fuzz(
(self.scheduled_days as f32) * ctx.lapse_multiplier,
minimum,
maximum,
);
(interval, None)
}
}