From 094593de2511285e63919e2dd005a5425f85879a Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Mon, 8 May 2023 20:47:57 +0800 Subject: [PATCH] :zap: Improve flashcard tree performance --- kernel/model/flashcard.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/model/flashcard.go b/kernel/model/flashcard.go index 4c693743f..b98d32f5e 100644 --- a/kernel/model/flashcard.go +++ b/kernel/model/flashcard.go @@ -396,12 +396,12 @@ func GetTreeDueFlashcards(rootID string, reviewedCardIDs []string) (ret []*Flash } func getTreeSubTreeChildBlocks(rootID string) (treeBlockIDs []string) { - tree, err := loadTreeByBlockID(rootID) - if nil != err { + root := treenode.GetBlockTree(rootID) + if nil == root { return } - bts := treenode.GetBlockTreesByPathPrefix(strings.TrimSuffix(tree.Path, ".sy")) + bts := treenode.GetBlockTreesByPathPrefix(strings.TrimSuffix(root.Path, ".sy")) for _, bt := range bts { treeBlockIDs = append(treeBlockIDs, bt.ID) }