This commit is contained in:
Liang Ding 2023-01-27 22:51:57 +08:00
parent 22a926946c
commit ff1e529d45
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -386,15 +386,8 @@ func IndexBlockTree(tree *parse.Tree) {
}
slice := val.(*btSlice)
slice.m.Lock()
if bt := slice.data[n.ID]; nil != bt {
if bt.Updated != n.IALAttr("updated") {
slice.data[n.ID] = &BlockTree{ID: n.ID, ParentID: parentID, RootID: tree.ID, BoxID: tree.Box, Path: tree.Path, HPath: tree.HPath, Updated: n.IALAttr("updated"), Type: TypeAbbr(n.Type.String())}
slice.changed = time.Now()
}
} else {
slice.data[n.ID] = &BlockTree{ID: n.ID, ParentID: parentID, RootID: tree.ID, BoxID: tree.Box, Path: tree.Path, HPath: tree.HPath, Updated: n.IALAttr("updated"), Type: TypeAbbr(n.Type.String())}
slice.changed = time.Now()
}
slice.data[n.ID] = &BlockTree{ID: n.ID, ParentID: parentID, RootID: tree.ID, BoxID: tree.Box, Path: tree.Path, HPath: tree.HPath, Updated: n.IALAttr("updated"), Type: TypeAbbr(n.Type.String())}
slice.changed = time.Now()
slice.m.Unlock()
return ast.WalkContinue
})