Commit 970d3243 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8512b5ae
...@@ -726,6 +726,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -726,6 +726,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Adone := SetKey{} // "processed" keys on A Adone := SetKey{} // "processed" keys on A
Bdone := SetKey{} // "processed" keys on B Bdone := SetKey{} // "processed" keys on B
if b != nil {
// XXX precise range as for a ^^^ ?
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: b} // [-∞, ∞)
bv = rangeSplit{btop}
}
// initial phase: expand changed nodes in a till buckets; // initial phase: expand changed nodes in a till buckets;
// XXX changed buckets -> δ- // XXX changed buckets -> δ-
if a != nil { if a != nil {
...@@ -772,14 +778,13 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -772,14 +778,13 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
} }
} }
// phase 2: iterate through keys queued for A and B, delve into
// corresponding nodes, and merge diff generated from them into δ.
// Each delve for A or B, potentially adds new keys to process on the
// other side.
for len(Aqueue) > 0 || len(Bqueue) > 0 { for len(Aqueue) > 0 || len(Bqueue) > 0 {
// expand keys in new δA -> in B till buckets; // expand keys in new δA -> in B till buckets;
// process B buckets that cover new keys into δ+ // process B buckets that cover new keys into δ+
if b != nil {
// XXX precise range as for a ^^^ ?
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: b} // [-∞, ∞)
bv = rangeSplit{btop}
}
for k := range Bqueue { for k := range Bqueue {
Bdone.Add(k) Bdone.Add(k)
bbucket, ok, err := bv.GetToBucket(ctx, k) bbucket, ok, err := bv.GetToBucket(ctx, 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