From d339eb17117df914796fdb3647fb591973f64e57 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 25 Dec 2024 09:47:27 +0800 Subject: [PATCH] Update src/optimal_retention.rs Co-authored-by: Luc Mcgrady --- src/optimal_retention.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optimal_retention.rs b/src/optimal_retention.rs index df73060..14f88f5 100644 --- a/src/optimal_retention.rs +++ b/src/optimal_retention.rs @@ -228,7 +228,7 @@ pub fn simulate( // Guards if card.due >= learn_span as f32 { if !is_learn { - let delta_t = learn_span - last_date_index; + let delta_t = learn_span.max(last_date_index) - last_date_index; let pre_sim_days = (-card.last_date) as usize; for i in 0..delta_t { memorized_cnt_per_day[last_date_index + i] +=