Skip to content

Commit

Permalink
Shift review_kind=3 check into SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Aug 21, 2023
1 parent eed185c commit 4111302
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/convertor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fn read_collection() -> Vec<RevlogEntry> {
FROM revlog
WHERE type != 4
AND ivl > 0
AND (factor != 0 or type != 3)
AND id < {}
AND cid < {}
AND cid IN (
Expand Down Expand Up @@ -130,10 +131,6 @@ fn extract_time_series_feature(
// 删除此 RevlogEntry 之前的所有条目
entries.drain(..index_to_keep);

// Remove RevlogEntry with review_kind = 3 and ease_factor = 0
// 去掉 review_kind = 3 且 ease_factor = 0 的 RevlogEntry
entries.retain(|entry| entry.review_kind != 3 || entry.ease_factor != 0);

// Increment review_kind of all entries by 1
// 将所有 review_kind + 1
for entry in &mut entries {
Expand Down

0 comments on commit 4111302

Please sign in to comment.