Skip to content

Commit

Permalink
Use backend for quickDeckDueTree()
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Jun 11, 2022
1 parent 00bcc9d commit 7a6a92c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ abstract class AbstractSched {
/**
* @return The tree of decks, without numbers
*/
abstract fun quickDeckDueTree(): List<TreeNode<DeckTreeNode>>
abstract fun<T : AbstractDeckTreeNode> quickDeckDueTree(): List<TreeNode<T>>

/** New count for a single deck.
* @param did The deck to consider (descendants and ancestors are ignored)
Expand Down
7 changes: 5 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/libanki/sched/SchedV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,11 @@ protected int _walkingCount(@NonNull LimitMethod limFn, @NonNull CountMethod cnt
requires multiple database access by deck. Ignoring this number
lead to the creation of a tree more quickly.*/
@Override
public @NonNull List<TreeNode<DeckTreeNode>> quickDeckDueTree() {
// Similar to deckDueTree, ignoring the numbers
public @NonNull
List<? extends TreeNode<? extends AbstractDeckTreeNode>> quickDeckDueTree() {
if (AnkiDroidApp.TESTING_USE_V16_BACKEND) {
return mCol.getBackend().legacyDeckDueTree(false);
}

// Similar to deckDueList
ArrayList<DeckTreeNode> allDecksSorted = new ArrayList<>();
Expand Down

0 comments on commit 7a6a92c

Please sign in to comment.