Commit 1c577863 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b34819df
...@@ -719,8 +719,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -719,8 +719,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
δ = map[Key]ΔValue{} δ = map[Key]ΔValue{}
defer fmt.Printf(" -> δt: %v\n", δ) defer fmt.Printf(" -> δt: %v\n", δ)
var av rangeSplit // nodes expanded from a var av rangeSplit // nodes expanded from a
var bv rangeSplit // nodes expanded from b var bv rangeSplit // nodes expanded from b
Aqueue := SetKey{} // "to process" keys on A
Bqueue := SetKey{} // "to process" keys on B
Adone := SetKey{} // "processed" keys on A
Bdone := SetKey{} // "processed" keys on B
// initial phase: expand changed nodes in a till buckets; // initial phase: expand changed nodes in a till buckets;
// XXX changed buckets -> δ- // XXX changed buckets -> δ-
...@@ -754,7 +758,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -754,7 +758,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// δ <- δA // δ <- δA
δMerge(δ, δA) δMerge(δ, δA)
// XXX AKeysDone <- δA // XXX Adone <- δA
// XXX Bqueue <- δA // XXX Bqueue <- δA
} }
} }
...@@ -769,8 +773,8 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -769,8 +773,8 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: b} // [-∞, ∞) btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: b} // [-∞, ∞)
bv = rangeSplit{btop} bv = rangeSplit{btop}
} }
for k := range Bkeysq { for k := range Bqueue {
BKeysDone.Add(k) Bdone.Add(k)
bbucket, ok, err := bv.GetToBucket(ctx, k) bbucket, ok, err := bv.GetToBucket(ctx, k)
if !ok { if !ok {
continue // key not covered continue // key not covered
...@@ -786,10 +790,10 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -786,10 +790,10 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// δ <- δB // δ <- δB
δMerge(δ, δB) δMerge(δ, δB)
// XXX Aqueue <- δB // Aqueue <- δB
for k, δv := range δ { for k, δv := range δ {
if !AKeysDone.Has(k) { if !Adone.Has(k) {
Akeysq.Add(k) Aqueue.Add(k)
} }
} }
......
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