Commit 43e6af88 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 17bd832f
......@@ -123,11 +123,24 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
}
// AddNodePath is a convenience wrapper to call AddPath starting from Nodes instead of Oids.
func (S PPTreeSubSet) AddNodePath(path []Node) { // XXX Tree|Bucket; path[0] = root
// XXX assert Tree Tree ... Tree Bucket
// root := path[0].(*Tree).POid()
func (S PPTreeSubSet) AddNodePath(path []Node) {
// assert path = Tree Tree ... Tree Bucket
l := len(path)
switch {
case l == 0:
panic("empty path")
case l == 1:
// must be empty Tree
_ = path[0].(*Tree)
default:
// must be Tree Tree ... Tree Bucket
for _, node := range path[:l-1] {
_ = node.(*Tree)
}
_ = path[l-1].(*Bucket)
}
oidv := make([]zodb.Oid, len(path))
oidv := make([]zodb.Oid, l)
for i, node := range path {
oidv[i] = node.POid()
}
......
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