Commit d1f62516 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f7215d1c
......@@ -342,12 +342,13 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) trackIndex {
// trackIdx records regular buckets or non-empty embedded bucket
// ( empty embedded bucket means there is just empty tree node
// and only that empty tree node is recorded in trackIdx )
trackKB := (kb.oid != zodb.InvalidOid || len(kb.kv) != 0)
if trackKB {
newNode := false
if (kb.oid != zodb.InvalidOid || len(kb.kv) != 0) {
track, already := trackIdx[kb.oid]
if !already {
track = &nodeTrack{parent: kb.parent.oid, nchild: 0}
trackIdx[kb.oid] = track
newNode = true
}
if track.parent != kb.parent.oid {
panicf("BUG: %s: B%s -> multiple parents: %s %s", rbs.coverage(), kb.oid, track.parent, kb.parent.oid)
......@@ -362,18 +363,21 @@ func (rbs RBucketSet) trackIdx(tracked SetKey) trackIndex {
}
pt, already := trackIdx[p.oid]
newParent := false
if !already {
pt = &nodeTrack{parent: ppoid, nchild: 0}
trackIdx[p.oid] = pt
newParent = true
}
if pt.parent != ppoid {
panicf("BUG: %s: T%s -> multiple parents: %s %s", rbs.coverage(), p.oid, pt.parent, ppoid)
}
if trackKB {
if newNode {
pt.nchild++
}
p = p.parent
newNode = newParent
}
}
return trackIdx
......
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