reformat code and write benchmark

This commit is contained in:
2026-05-12 16:57:05 +03:00
parent ee817a8e8c
commit 6d656c35e1
9 changed files with 367 additions and 62 deletions
+3 -2
View File
@@ -349,11 +349,12 @@ impl CardSet {
if !word_ids.contains(&stat.word_id) {
delete_stat(&stat, &state_locked.connection);
current_set.remove(index);
}else{
index += 1;
}
index += 1;
}
let weights = current_set.iter().map(|s| (100.0 / s.calculated_score()).powf(2.0)).collect::<Vec<f32>>();
let weights = current_set.iter().map(|s| (100.0 / s.calculated_score()).powf(2.0) * 2.0).collect::<Vec<f32>>();
let indexes = WeightedIndex::new(weights).unwrap();
Self {