|
@@ -292,16 +292,16 @@ func ReindexBlockTree(tree *parse.Tree) {
|
|
blockTreesLock.Lock()
|
|
blockTreesLock.Lock()
|
|
defer blockTreesLock.Unlock()
|
|
defer blockTreesLock.Unlock()
|
|
|
|
|
|
- var ids []string
|
|
|
|
- for _, b := range blockTrees {
|
|
|
|
- if b.RootID == tree.ID {
|
|
|
|
- ids = append(ids, b.ID)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ids = gulu.Str.RemoveDuplicatedElem(ids)
|
|
|
|
- for _, id := range ids {
|
|
|
|
- delete(blockTrees, id)
|
|
|
|
- }
|
|
|
|
|
|
+ //var ids []string
|
|
|
|
+ //for _, b := range blockTrees {
|
|
|
|
+ // if b.RootID == tree.ID {
|
|
|
|
+ // ids = append(ids, b.ID)
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ //ids = gulu.Str.RemoveDuplicatedElem(ids)
|
|
|
|
+ //for _, id := range ids {
|
|
|
|
+ // delete(blockTrees, id)
|
|
|
|
+ //}
|
|
|
|
|
|
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
|
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
|
|
if !entering || !n.IsBlock() {
|
|
if !entering || !n.IsBlock() {
|