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

.

parent 96c28df2
...@@ -532,13 +532,13 @@ func (rs rangeSplit) Get(k Key) *nodeInRange { // XXX -> Get_ -> rn, ok ...@@ -532,13 +532,13 @@ func (rs rangeSplit) Get(k Key) *nodeInRange { // XXX -> Get_ -> rn, ok
// rnode must be initially in *prs. // rnode must be initially in *prs.
// rnode.node must be tree. // rnode.node must be tree.
// rnode.node must be aleady activated. // rnode.node must be aleady activated.
func (prs *rangeCover) Expand(rnode *nodeInRange) []*nodeInRange { func (prs *rangeSplit) Expand(rnode *nodeInRange) []*nodeInRange {
rs := *prs rs := *prs
i := sort.Search(len(rs), func(i int) bool { i := sort.Search(len(rs), func(i int) bool {
return rnode.hi_ <= rs[i].hi_ return rnode.hi_ <= rs[i].hi_
}) })
if i == len(rs) || rs[i] != rnode { if i == len(rs) || rs[i] != rnode {
panicf("%s not in rangeCover", rnode) panicf("%s not in rangeSplit", rnode)
} }
// [i].Key ≤ [i].Child.*.Key < [i+1].Key i ∈ [0, len([])) // [i].Key ≤ [i].Child.*.Key < [i+1].Key i ∈ [0, len([]))
...@@ -566,9 +566,9 @@ func (prs *rangeCover) Expand(rnode *nodeInRange) []*nodeInRange { ...@@ -566,9 +566,9 @@ func (prs *rangeCover) Expand(rnode *nodeInRange) []*nodeInRange {
return children return children
} }
func (rc rangeCover) String() string { func (rs rangeSplit) String() string {
s := "" s := ""
for _, rn := range rc { for _, rn := range rs {
if s != "" { if s != "" {
s += " " s += " "
} }
...@@ -698,14 +698,14 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -698,14 +698,14 @@ 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 rangeCover var av rangeSplit
var bv rangeCover var bv rangeSplit
// initial phase: expand changed nodes in a till buckets // initial phase: expand changed nodes in a till buckets
// XXX maybe walk till a from root to get more precise initial range? // XXX maybe walk till a from root to get more precise initial range?
if a != nil { if a != nil {
atop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: a} // [-∞, ∞) atop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: a} // [-∞, ∞)
av = rangeCover{atop} av = rangeSplit{atop}
aq := []*nodeInRange{atop} // stack aq := []*nodeInRange{atop} // stack
for len(aq) > 0 { for len(aq) > 0 {
l := len(aq) l := len(aq)
......
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