Skip to content

Commit

Permalink
Revert "Fix/only let FSRS take over short-term schedule when steps ar…
Browse files Browse the repository at this point in the history
…e empty (ankitects#3496)"

This reverts commit f804abf.

I want to keep this functionality :)
The change in the .clamp() value seems unrelated so  I'm keeping that. I'm also keeping the new is_empty() function. No reason to have a bigger diff than necessary.
  • Loading branch information
mlidbom committed Oct 16, 2024
1 parent c1a2b03 commit 5d2cd8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
15 changes: 3 additions & 12 deletions rslib/src/scheduler/states/learning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ impl LearnState {
} else {
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
let (interval, short_term) = if let Some(states) = &ctx.fsrs_next_states {
(
states.again.interval,
ctx.steps.is_empty() && states.again.interval < 0.5,
)
(states.again.interval, states.again.interval < 0.5)
} else {
(ctx.graduating_interval_good as f32, false)
};
Expand Down Expand Up @@ -94,10 +91,7 @@ impl LearnState {
} else {
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
let (interval, short_term) = if let Some(states) = &ctx.fsrs_next_states {
(
states.hard.interval,
ctx.steps.is_empty() && states.hard.interval < 0.5,
)
(states.hard.interval, states.hard.interval < 0.5)
} else {
(ctx.graduating_interval_good as f32, false)
};
Expand Down Expand Up @@ -139,10 +133,7 @@ impl LearnState {
} else {
let (minimum, maximum) = ctx.min_and_max_review_intervals(1);
let (interval, short_term) = if let Some(states) = &ctx.fsrs_next_states {
(
states.good.interval,
ctx.steps.is_empty() && states.good.interval < 0.5,
)
(states.good.interval, states.good.interval < 0.5)
} else {
(ctx.graduating_interval_good as f32, false)
};
Expand Down
18 changes: 9 additions & 9 deletions rslib/src/scheduler/states/relearning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ impl RelearnState {
},
review: again_review,
};
if ctx.relearn_steps.is_empty() && interval < 0.5 {
again_relearn.into()
} else {
if interval > 0.5 {
again_review.into()
} else {
again_relearn.into()
}
} else {
self.review.into()
Expand Down Expand Up @@ -112,10 +112,10 @@ impl RelearnState {
},
review: hard_review,
};
if ctx.relearn_steps.is_empty() && interval < 0.5 {
hard_relearn.into()
} else {
if interval > 0.5 {
hard_review.into()
} else {
hard_relearn.into()
}
} else {
self.review.into()
Expand Down Expand Up @@ -162,10 +162,10 @@ impl RelearnState {
},
review: good_review,
};
if ctx.relearn_steps.is_empty() && interval < 0.5 {
good_relearn.into()
} else {
if interval > 0.5 {
good_review.into()
} else {
good_relearn.into()
}
} else {
self.review.into()
Expand Down
2 changes: 1 addition & 1 deletion rslib/src/scheduler/states/review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl ReviewState {
review: again_review,
}
.into()
} else if ctx.relearn_steps.is_empty() && scheduled_days < 0.5 {
} else if scheduled_days < 0.5 {
again_relearn.into()
} else {
again_review.into()
Expand Down

0 comments on commit 5d2cd8e

Please sign in to comment.