mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
⚡ Improve performance for transfer block ref
This commit is contained in:
parent
f9a38c41a2
commit
fe8520d1ac
1 changed files with 4 additions and 2 deletions
|
|
@ -325,11 +325,13 @@ func TransferBlockRef(fromID, toID string, refIDs []string) (err error) {
|
||||||
if 1 > len(refIDs) { // 如果不指定 refIDs,则转移所有引用了 fromID 的块
|
if 1 > len(refIDs) { // 如果不指定 refIDs,则转移所有引用了 fromID 的块
|
||||||
refIDs, _ = sql.QueryRefIDsByDefID(fromID, false)
|
refIDs, _ = sql.QueryRefIDsByDefID(fromID, false)
|
||||||
}
|
}
|
||||||
for _, refID := range refIDs {
|
|
||||||
tree, _ := LoadTreeByBlockID(refID)
|
trees := filesys.LoadTrees(refIDs)
|
||||||
|
for refID, tree := range trees {
|
||||||
if nil == tree {
|
if nil == tree {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
node := treenode.GetNodeInTree(tree, refID)
|
node := treenode.GetNodeInTree(tree, refID)
|
||||||
textMarks := node.ChildrenByType(ast.NodeTextMark)
|
textMarks := node.ChildrenByType(ast.NodeTextMark)
|
||||||
for _, textMark := range textMarks {
|
for _, textMark := range textMarks {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue