mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Ensure minimum doesn't exceed maximum
With a maximum interval set, it would be possible to confuse with_review_fuzz() by passing min > max.
This commit is contained in:
parent
da257eead2
commit
37ce4e8426
1 changed files with 4 additions and 1 deletions
|
@ -135,8 +135,11 @@ impl RelearnState {
|
||||||
fn answer_easy(self, ctx: &StateContext) -> ReviewState {
|
fn answer_easy(self, ctx: &StateContext) -> ReviewState {
|
||||||
let scheduled_days = if let Some(states) = &ctx.fsrs_next_states {
|
let scheduled_days = if let Some(states) = &ctx.fsrs_next_states {
|
||||||
let (mut minimum, maximum) = ctx.min_and_max_review_intervals(1);
|
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);
|
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;
|
let interval = states.easy.interval;
|
||||||
ctx.with_review_fuzz(interval as f32, minimum, maximum)
|
ctx.with_review_fuzz(interval as f32, minimum, maximum)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue