Commit 10ca3c4e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1233d221
...@@ -764,9 +764,37 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -764,9 +764,37 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
aq := []*nodeInRange{atop} // stack aq := []*nodeInRange{atop} // stack
for len(aq) > 0 { for len(aq) > 0 {
l := len(aq) l := len(aq)
arn := aq[l-1]; aq=aq[:l-1] // arn=aq.pop() arn := aq[l-1]; aq=aq[:l-1] // arn=aq.pop()
err := arn.node.PActivate(ctx); if err != nil { return nil, err} atree := arn.node.(*Tree) // ok - only trees in aq
defer arn.node.PDeactivate() err = atree.PActivate(ctx); if err != nil { return nil, err}
defer atree.PDeactivate()
if len(atree.Entryv()) == 0 {
// empty tree - do not expand into bucket - only process tracked holes
// XXX dup wrt bucket processing?
track, ok := trackIdx[atree.POid()]
if !ok {
panicf("%s ∈ δZTC, but ∉ trackIdx", vnode(atree))
}
δA := map[Key]ΔValue{}
for k := range track.holes {
δA[k] = ΔValue{VDEL, VDEL} // ø->ø indicates hole
}
// δ <- δA
err = δMerge(δ, δA)
if err != nil {
return nil, err
}
// Adone <- δA
// Bqueue <- δA
for k := range δA {
Adone.Add(k)
Bqueue.Add(k)
}
continue
}
children := av.Expand(arn) children := av.Expand(arn)
// fmt.Printf("Y children: %s\n", children) // fmt.Printf("Y children: %s\n", children)
......
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