Commit 18010d1d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 33c0c2e9
......@@ -565,10 +565,11 @@ ABcov:
}
}
// {} oid -> parent for all nodes in Bv: current and previously expanded - up till top B
BtrackSet := PPTreeSubSet{}
// {} oid -> nodeInRange for all nodes we've came through in Bv:
// current and previously expanded - up till top B
BnodeIdx := map[zodb.Oid]*nodeInRange{}
if !Bempty {
BtrackSet.AddPath(ABpath)
BnodeIdx[ABoid] = btop
}
// δtkeycov will be = BAdd \ ADel
......@@ -632,7 +633,7 @@ ABcov:
// ( this does not give exact answer but should be a reasonable heuristic;
// the diff is the same if heuristic does not work and we
// look into and load more nodes to compute δ )
_, found := BtrackSet[acOid]
bc, found := BnodeIdx[acOid]
if !found {
for {
blo := Bv.Get(ac.lo)
......@@ -652,11 +653,12 @@ ABcov:
}
bchildren := Bv.Expand(blo)
for _, bc := range bchildren {
bcOid := bc.node.POid()
BtrackSet.AddPath(bc.Path())
if acOid == bcOid {
for _, bc_ := range bchildren {
bc_Oid := bc_.node.POid()
BnodeIdx[bc_Oid] = bc_
if acOid == bc_Oid {
found = true
bc = bc_
}
}
if found {
......@@ -667,8 +669,8 @@ ABcov:
if found {
// ac can be skipped
// adjust trackSet since path to the node could have changed
apath := trackSet.Path(acOid)
bpath := BtrackSet.Path(acOid)
apath := ac.Path()
bpath := bc.Path()
if !pathEqual(apath, bpath) {
δtrack.Del.AddPath(apath)
δtrack.Add.AddPath(bpath)
......@@ -681,7 +683,6 @@ ABcov:
// adjust δtkeycov only if it was leaf bucket
if nc := at.nchild; nc == 0 {
ar := KeyRange{ac.lo, ac.hi_}
bc := Bv.Get(ac.lo)
br := KeyRange{bc.lo, bc.hi_}
δtkeycovADel.AddRange(ar)
δtkeycovBAdd.AddRange(br)
......
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