Commit 78ca2fad authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent eaced681
...@@ -141,7 +141,7 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) { ...@@ -141,7 +141,7 @@ func (S PPTreeSubSet) AddPath(path []zodb.Oid) {
// Union returns U = PP(A.leafs | B.leafs) // Union returns U = PP(A.leafs | B.leafs)
// //
// In other words it returns sum of A and B. // In other words it adds A and B nodes.
func (A PPTreeSubSet) Union(B PPTreeSubSet) PPTreeSubSet { func (A PPTreeSubSet) Union(B PPTreeSubSet) PPTreeSubSet {
U := A.Clone() U := A.Clone()
U.UnionInplace(B) U.UnionInplace(B)
...@@ -168,7 +168,7 @@ func (A PPTreeSubSet) UnionInplace(B PPTreeSubSet) { ...@@ -168,7 +168,7 @@ func (A PPTreeSubSet) UnionInplace(B PPTreeSubSet) {
// Difference returns D = PP(A.leafs \ B.leafs) // Difference returns D = PP(A.leafs \ B.leafs)
// //
// In other words ... XXX // In other words it removes B nodes from A while still maintaining A as PP-connected.
func (A PPTreeSubSet) Difference(B PPTreeSubSet) PPTreeSubSet { func (A PPTreeSubSet) Difference(B PPTreeSubSet) PPTreeSubSet {
D := A.Clone() D := A.Clone()
D.DifferenceInplace(B) D.DifferenceInplace(B)
......
...@@ -251,9 +251,12 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error { ...@@ -251,9 +251,12 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
root := path[0] root := path[0]
// XXX first normalize path
// nothing to do if key is already tracked // nothing to do if key is already tracked
leaf := path[len(path)-1] leaf := path[len(path)-1]
if δBtail.trackSet.Has(leaf) { if δBtail.trackSet.Has(leaf) {
tracefΔBtail("->T: nop\n")
path_ := δBtail.trackSet.Path(leaf) path_ := δBtail.trackSet.Path(leaf)
if !pathEqual(path, path_) { if !pathEqual(path, path_) {
panicf("BUG: key %s is already tracked via path=%v\ntrack requests path=%v", kstr(key), path_, path) panicf("BUG: key %s is already tracked via path=%v\ntrack requests path=%v", kstr(key), path_, path)
...@@ -270,6 +273,7 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error { ...@@ -270,6 +273,7 @@ func (δBtail *ΔBtail) track(key Key, path []zodb.Oid) error {
δBtail.trackNewRoots.Add(root) δBtail.trackNewRoots.Add(root)
δTtail.trackNew.AddPath(path) δTtail.trackNew.AddPath(path)
tracefΔBtail("->T: [%s].trackNew -> %s\n", root, δTtail.trackNew)
return nil return nil
} }
......
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