mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
♻️ Improve cache ds
This commit is contained in:
parent
04c46b3a56
commit
8cefe5ce47
5 changed files with 46 additions and 46 deletions
|
|
@ -280,10 +280,10 @@ func generateAttrViewItems(attrView *av.AttributeView, view *av.View) (ret map[s
|
|||
return
|
||||
}
|
||||
|
||||
func filterNotFoundAttrViewItems(keyValuesMap *map[string][]*av.KeyValues) {
|
||||
func filterNotFoundAttrViewItems(keyValuesMap map[string][]*av.KeyValues) {
|
||||
var notFound []string
|
||||
var toCheckBlockIDs []string
|
||||
for blockID, keyValues := range *keyValuesMap {
|
||||
for blockID, keyValues := range keyValuesMap {
|
||||
blockValue := getBlockValue(keyValues)
|
||||
if nil == blockValue || nil == blockValue.Block {
|
||||
notFound = append(notFound, blockID)
|
||||
|
|
@ -308,7 +308,7 @@ func filterNotFoundAttrViewItems(keyValuesMap *map[string][]*av.KeyValues) {
|
|||
}
|
||||
}
|
||||
for _, blockID := range notFound {
|
||||
delete(*keyValuesMap, blockID)
|
||||
delete(keyValuesMap, blockID)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ func RenderAttributeViewGallery(attrView *av.AttributeView, view *av.View, query
|
|||
}
|
||||
|
||||
cardsValues := generateAttrViewItems(attrView, view) // 生成卡片
|
||||
filterNotFoundAttrViewItems(&cardsValues) // 过滤掉不存在的卡片
|
||||
filterNotFoundAttrViewItems(cardsValues) // 过滤掉不存在的卡片
|
||||
|
||||
// 批量加载绑定块对应的树
|
||||
var ialIDs []string
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
|
|||
}
|
||||
|
||||
rowsValues := generateAttrViewItems(attrView, view) // 生成行
|
||||
filterNotFoundAttrViewItems(&rowsValues) // 过滤掉不存在的行
|
||||
filterNotFoundAttrViewItems(rowsValues) // 过滤掉不存在的行
|
||||
|
||||
// 生成行单元格
|
||||
for rowID, rowValues := range rowsValues {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue