mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
♻️ Clean code
This commit is contained in:
parent
9c512960bc
commit
f3574038e2
28 changed files with 160 additions and 130 deletions
|
|
@ -54,7 +54,7 @@ type AttrView struct {
|
|||
func GetDocInfo(blockID string) (ret *BlockInfo) {
|
||||
WaitForWritingFiles()
|
||||
|
||||
tree, err := loadTreeByBlockID(blockID)
|
||||
tree, err := LoadTreeByBlockID(blockID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("load tree by root id [%s] failed: %s", blockID, err)
|
||||
return
|
||||
|
|
@ -129,7 +129,7 @@ func GetBlockRefText(id string) string {
|
|||
return ErrBlockNotFound.Error()
|
||||
}
|
||||
|
||||
tree, err := loadTreeByBlockID(id)
|
||||
tree, err := LoadTreeByBlockID(id)
|
||||
if nil != err {
|
||||
return ErrTreeNotFound.Error()
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ func GetBlockDefIDsByRefText(refText string, excludeIDs []string) (ret []string)
|
|||
}
|
||||
|
||||
func GetBlockIndex(id string) (ret int) {
|
||||
tree, _ := loadTreeByBlockID(id)
|
||||
tree, _ := LoadTreeByBlockID(id)
|
||||
if nil == tree {
|
||||
return
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ type BlockPath struct {
|
|||
|
||||
func BuildBlockBreadcrumb(id string, excludeTypes []string) (ret []*BlockPath, err error) {
|
||||
ret = []*BlockPath{}
|
||||
tree, err := loadTreeByBlockID(id)
|
||||
tree, err := LoadTreeByBlockID(id)
|
||||
if nil == tree {
|
||||
err = nil
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue