Fix semirandom srs bug

This commit is contained in:
micialware committed 2026-08-20 18:27:05 +03:00
1 parent c5c1f34e1c
commit e8c9e37ca1
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -17,7 +17,9 @@ pub fn create_db() {
}
}
fn ensure_db_schema(_: &Connection) {}
fn ensure_db_schema(connection: &Connection) {
}
fn create_tables(conn: &Connection) {
make_card_set(conn).unwrap();
+1 -1
View File
@@ -542,7 +542,7 @@ impl SRSModule for SemiRandomSRSModule {
fn next(&mut self, set: &mut DeckData) -> usize {
let index = self.last_weights.sample(&mut self.generator);
if self.history.contains(&index) {
if self.history.contains(&index) && self.history.len() != 1 {
return self.next(set);
}