Commit 9694761d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ece1c216
...@@ -913,7 +913,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -913,7 +913,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
bnode.done = true bnode.done = true
} }
// add k as hole if k is not there // k is not there -> +[k]ø
if !Bdone.Has(k) { if !Bdone.Has(k) {
δB := map[Key]ΔValue{k: {VDEL, VDEL}} // hole δB := map[Key]ΔValue{k: {VDEL, VDEL}} // hole
err = δMerge(δ, δB); if err != nil { return nil, err } err = δMerge(δ, δB); if err != nil { return nil, err }
...@@ -927,8 +927,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -927,8 +927,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Bqueue = SetKey{} Bqueue = SetKey{}
for k := range Aqueue { for k := range Aqueue {
fmt.Printf(" A [%v]\n", k) fmt.Printf(" A [%v]\n", k)
Adone.Add(k) anode, ok, err := av.GetToLeaf(ctx, k)
abucket, ok, err := av.GetToLeaf(ctx, k)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -939,13 +938,13 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -939,13 +938,13 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// XXX check for anode.node.(*Tree) (ø tree case) // XXX check for anode.node.(*Tree) (ø tree case)
// - bucket if not already done // - bucket if that bucket is reached for the first time
// XXX also extract holes if !anode.done {
if !abucket.done { δA, err := diffB(ctx, anode.node.(*Bucket), nil)
δA, err := diffB(ctx, abucket.node.(*Bucket), nil)
if err != nil { if err != nil {
return nil, err return nil, err
} }
// XXX also extract holes
// δ <- δA // δ <- δA
err = δMerge(δ, δA) err = δMerge(δ, δA)
...@@ -953,14 +952,21 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -953,14 +952,21 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return nil, err return nil, err
} }
// Adone <- δA
// Bqueue <- δA // Bqueue <- δA
for k := range δA { for k_ := range δA {
if !Bdone.Has(k) { Adone.Add(k_)
Bqueue.Add(k) if !Bdone.Has(k_) {
Bqueue.Add(k_)
} }
} }
abucket.done = true anode.done = true
}
// k is not there -> -[k]ø
if !Adone.Has(k) {
// XXX
} }
fmt.Printf(" av: %s\n", av) fmt.Printf(" av: %s\n", av)
......
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