mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 00:36:38 -04:00
Format eases.rs
This commit is contained in:
parent
1ae6536728
commit
e57c880bd1
1 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@ impl GraphsContext {
|
||||||
ease_values.push(card.ease_factor as f32);
|
ease_values.push(card.ease_factor as f32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eases.average = median(&mut ease_values) / 10.0;
|
eases.average = median(&mut ease_values) / 10.0;
|
||||||
difficulty.average = median(&mut difficulty_values) * 100.0;
|
difficulty.average = median(&mut difficulty_values) * 100.0;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ impl GraphsContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper function to calculate the median of a vector
|
/// Helper function to calculate the median of a vector
|
||||||
fn median(data: &mut Vec<f32>) -> f32 {
|
fn median(data: &mut [f32]) -> f32 {
|
||||||
if data.is_empty() {
|
if data.is_empty() {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue