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

.

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