Fix semirandom srs bug
This commit is contained in:
1 parent
c5c1f34e1c
commit
e8c9e37ca1
2 files changed
+4
-2
No files matched your search
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user