Commit 08d1b294 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 719088f6
......@@ -425,6 +425,7 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
}
// XXX place
// XXX doc
func (tidx trackIndex) AddPath(path []Node) { // XXX Tree|Bucket; path[0] = root
l := len(path)
if l == 0 {
......@@ -599,6 +600,16 @@ type nodeInRange struct {
done bool // whether this node was already taken into account while computing diff
}
// XXX place, doc
func (n *nodeInRange) NodePath() []Node {
path := []Node{}
for n != nil {
path = append([]Node{n.node}, path...)
n = n.parent
}
return path
}
// rangeSplit represents set of nodes covering a range.
// nodes come with key↑ and no intersection in between their [lo,hi)
type rangeSplit []*nodeInRange // key↑
......@@ -664,9 +675,10 @@ func (prs *rangeSplit) Expand(rnode *nodeInRange) (children rangeSplit) {
}
children = append(children, &nodeInRange{
lo: lo,
hi_: hi_,
node: treev[i].Child(),
parent: rnode,
lo: lo,
hi_: hi_,
node: treev[i].Child(),
})
}
......@@ -900,8 +912,8 @@ func diffT(ctx context.Context, A, B *Tree, δZTC SetOid, trackIdx trackIndex, h
// initial split ranges for A and B
// XXX maybe walk till a from root to get more precise initial range?
atop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: A} // [-∞, ∞)
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: B} // [-∞, ∞)
atop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: A} // [-∞, ∞) XXX parent?
btop := &nodeInRange{lo: KeyMin, hi_: KeyMax, node: B} // [-∞, ∞) XXX parent?
Av := rangeSplit{atop} // nodes expanded from A
Bv := rangeSplit{btop} // nodes expanded from B
......
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