Commit 798f7dc6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9acd5150
......@@ -116,29 +116,6 @@ func (δ *ΔPPTreeSubSet) Reverse() {
}
// gc1 garbage-collects oid and cleans up its parent down-up.
func (tidx PPTreeSubSet) gc1(oid zodb.Oid) {
t, present := tidx[oid]
if !present {
return // already not there
}
if t.nchild != 0 {
panicf("gc %s %v (nchild != 0)", oid, t)
}
delete(tidx, oid)
oid = t.parent
for oid != zodb.InvalidOid {
t := tidx[oid]
t.nchild--
if t.nchild > 0 || /* root node */t.parent == zodb.InvalidOid {
break
}
delete(tidx, oid)
oid = t.parent
}
}
// verify verifies internal consistency of tidx.
func (tidx PPTreeSubSet) verify() {
// XXX !debug -> return
......@@ -299,6 +276,29 @@ func (A PPTreeSubSet) xfixup(sign int, δnchild map[zodb.Oid]int) {
}
}
// gc1 garbage-collects oid and cleans up its parent down-up.
func (tidx PPTreeSubSet) gc1(oid zodb.Oid) {
t, present := tidx[oid]
if !present {
return // already not there
}
if t.nchild != 0 {
panicf("gc %s %v (nchild != 0)", oid, t)
}
delete(tidx, oid)
oid = t.parent
for oid != zodb.InvalidOid {
t := tidx[oid]
t.nchild--
if t.nchild > 0 || /* root node */t.parent == zodb.InvalidOid {
break
}
delete(tidx, oid)
oid = t.parent
}
}
// UnionInplace sets A = PP(A.leafs | B.leafs)
//
// In other words it adds B nodes to A.
......
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