Browse Source

:zap: 改进打开虚拟引用后加载文档的性能 https://github.com/siyuan-note/siyuan/issues/7378

Liang Ding 2 years ago
parent
commit
ef029d4dea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      kernel/model/virutalref.go

+ 2 - 2
kernel/model/virutalref.go

@@ -48,8 +48,8 @@ var virtualBlockRefCache, _ = ristretto.NewCache(&ristretto.Config{
 })
 
 func getBlockVirtualRefKeywords(root *ast.Node) (ret []string) {
-	val, ok := virtualBlockRefCache.Get(root.ID)
-	if !ok {
+	val, _ := virtualBlockRefCache.Get(root.ID)
+	if nil == val {
 		return
 	}
 	ret = val.([]string)