Fix/Simulator intervals decending overflows (#4275)

* Fix/Simulator intervals decending overflows

* saturating_sub

* oops
This commit is contained in:
Luc Mcgrady 2025-09-01 05:16:40 +01:00 committed by GitHub
parent 359231a4d8
commit 211cbfe660
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,7 +97,7 @@ fn create_review_priority_fn(
// Interval-based ordering // Interval-based ordering
IntervalsAscending => wrap!(|c, _w| c.interval as i32), IntervalsAscending => wrap!(|c, _w| c.interval as i32),
IntervalsDescending => wrap!(|c, _w| -(c.interval as i32)), IntervalsDescending => wrap!(|c, _w| (c.interval as i32).saturating_neg()),
// Retrievability-based ordering // Retrievability-based ordering
RetrievabilityAscending => { RetrievabilityAscending => {
wrap!(move |c, w| (c.retrievability(w) * 1000.0) as i32) wrap!(move |c, w| (c.retrievability(w) * 1000.0) as i32)