From 7fb425441b081d85e33ce237e89938fc2b9db240 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 19 Aug 2025 23:43:01 +0100 Subject: [PATCH] saturating_sub --- rslib/src/scheduler/fsrs/simulator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index 85e29cdc0..b9b58050c 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -97,7 +97,7 @@ fn create_review_priority_fn( // Interval-based ordering IntervalsAscending => wrap!(|c, _w| c.interval as i32), - IntervalsDescending => wrap!(|c, _w| -((c.interval as i32).max(-i32::MAX))), + IntervalsDescending => wrap!(|c, _w| 0i32.saturating_sub(c.interval as i32)), // Retrievability-based ordering RetrievabilityAscending => { wrap!(move |c, w| (c.retrievability(w) * 1000.0) as i32)