Apply suggestions from code review

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
This commit is contained in:
Luc Mcgrady 2025-06-02 13:13:59 +01:00 committed by GitHub
parent 423e5a53fc
commit 1fe98f2514
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,8 +119,8 @@ impl Collection {
};
let mut params = fsrs.compute_parameters(input.clone())?;
progress_thread.join().ok();
if let Ok(fsrs) = FSRS::new(Some(current_params)) {
let current_log_loss = fsrs.evaluate(items.clone(), |_| true)?.log_loss;
if let Ok(current_fsrs) = FSRS::new(Some(current_params)) {
let current_log_loss = current_fsrs.evaluate(items.clone(), |_| true)?.log_loss;
let optimized_fsrs = FSRS::new(Some(&params))?;
let optimized_log_loss = optimized_fsrs.evaluate(items.clone(), |_| true)?.log_loss;
if current_log_loss <= optimized_log_loss {