This commit is contained in:
Daniel 2025-06-22 16:55:24 +08:00
parent 2e2f152311
commit 17369d28c9
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 47 additions and 11 deletions

View file

@ -276,6 +276,34 @@ func nodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi
return buf.String()
}
func BatchGetBlockAttrsWitTrees(ids []string, trees map[string]*parse.Tree) (ret map[string]map[string]string) {
ret = map[string]map[string]string{}
hitCache := true
for _, id := range ids {
ial := cache.GetBlockIAL(id)
if nil != ial {
ret[id] = ial
continue
}
hitCache = false
break
}
if hitCache {
return
}
for _, id := range ids {
tree := trees[id]
if nil == tree {
continue
}
ret[id] = getBlockAttrsFromTree(id, tree)
}
return
}
func BatchGetBlockAttrs(ids []string) (ret map[string]map[string]string) {
ret = map[string]map[string]string{}