Commit d3e4212a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ac4ff8df
...@@ -818,19 +818,23 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -818,19 +818,23 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// ( this does not give exact answer but should be a reasonable heuristic; // ( this does not give exact answer but should be a reasonable heuristic;
// the diff is the same if heuristic does not work and we // the diff is the same if heuristic does not work and we
// look into and load more nodes to compute δ ) // look into and load more nodes to compute δ )
_, ok := BtrackIdx[acOid] _, found := BtrackIdx[acOid]
if !ok { if !found {
for { for {
blo := Bv.Get(ac.lo) blo := Bv.Get(ac.lo)
bhi_ := Bv.Get(ac.hi_) bhi_ := Bv.Get(ac.hi_)
if blo != bhi_ { if blo != bhi_ {
break break
} }
_, ok := blo.node.(*Tree)
if !ok {
break // bucket
}
err = blo.node.PActivate(ctx); /*X*/if err != nil { return nil, err } err = blo.node.PActivate(ctx); /*X*/if err != nil { return nil, err }
defer blo.node.PDeactivate() defer blo.node.PDeactivate()
// XXX check for empty tree?
bchildren := Bv.Expand(blo) bchildren := Bv.Expand(blo)
found := false
for _, bc := range bchildren { for _, bc := range bchildren {
bcOid := bc.node.POid() bcOid := bc.node.POid()
BtrackIdx[bcOid] = nodeTrack{parent: blo.node.POid()} BtrackIdx[bcOid] = nodeTrack{parent: blo.node.POid()}
...@@ -843,7 +847,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -843,7 +847,7 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
} }
} }
} }
if ok { if found {
// ac can be skipped // ac can be skipped
// XXX Bkqueue <- holes(ac.range \ bc.range) // XXX Bkqueue <- holes(ac.range \ bc.range)
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment