found bug in random srs
This commit is contained in:
1 parent
01ba0567f5
commit
c5e91b844c
3 files changed
+17
-29
No files matched your search
+1
-12
@@ -364,17 +364,6 @@ impl DeckData {
|
||||
.map(|w| &state_locked.dictionary[*w])
|
||||
.cloned()
|
||||
.collect();
|
||||
let word_ids = last_list.iter().map(|l| l.id).collect::<Vec<Id>>();
|
||||
|
||||
let mut index = 0;
|
||||
for stat in current_set.clone() {
|
||||
if !word_ids.contains(&stat.word_id) {
|
||||
delete_stat(&stat, &state_locked.connection);
|
||||
current_set.remove(index);
|
||||
} else {
|
||||
index += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Self {
|
||||
set: current_set,
|
||||
@@ -515,7 +504,7 @@ impl SRSModule for RandomSRSModule {
|
||||
|
||||
fn init(&mut self, set: &mut DeckData) {
|
||||
self.initialized = true;
|
||||
self.basket = (0..set.words.len()).collect::<Vec<usize>>();
|
||||
self.basket = (0..set.set.len()).collect::<Vec<usize>>();
|
||||
self.basket.shuffle(&mut rand::rng())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user