Fix/ignore revlogs before Forget entry (#3002)

* Fix/ignore revlogs before Forget entry

* Update weights.rs
This commit is contained in:
Jarrett Ye 2024-02-12 14:09:39 +08:00 committed by GitHub
parent 9ba527afa2
commit 492178c107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,6 +201,15 @@ pub(crate) fn single_card_revlog_to_items(
revlogs_complete = true;
} else if last_learn_entry.is_some() {
break;
// if we find the `Forget` entry before the `Learn` entry, we should
// ignore all the entries
} else if matches!(
(entry.review_kind, entry.ease_factor),
(RevlogReviewKind::Manual, 0)
) && last_learn_entry.is_none()
{
revlogs_complete = false;
break;
}
}
if !revlogs_complete {