⚡ Improve block ref searching performance https://github.com/siyuan-note/siyuan/issues/11951
This commit is contained in:
parent
d4b60520d9
commit
5f56e42dee
1 changed files with 6 additions and 1 deletions
|
@ -324,10 +324,15 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int, isSquareBrackets,
|
|||
|
||||
ignoreLines := getRefSearchIgnoreLines()
|
||||
refs := sql.QueryRefsRecent(onlyDoc, ignoreLines)
|
||||
var btsID []string
|
||||
for _, ref := range refs {
|
||||
btsID = append(btsID, ref.DefBlockRootID)
|
||||
}
|
||||
bts := treenode.GetBlockTrees(btsID)
|
||||
for _, ref := range refs {
|
||||
tree := cachedTrees[ref.DefBlockRootID]
|
||||
if nil == tree {
|
||||
tree, _ = LoadTreeByBlockID(ref.DefBlockRootID)
|
||||
tree, _ = loadTreeByBlockTree(bts[ref.DefBlockRootID])
|
||||
}
|
||||
if nil == tree {
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue