Commit 064efa3c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8672b6d8
...@@ -90,7 +90,7 @@ type ΔBtail struct { ...@@ -90,7 +90,7 @@ type ΔBtail struct {
// includes all changed objects, not only tracked ones. // includes all changed objects, not only tracked ones.
δZtail *zodb.ΔTail δZtail *zodb.ΔTail
vδBroots []ΔBroots // [] (rev↑, roots changed in this rev) vδBroots []_ΔBroots // [] (rev↑, roots changed in this rev)
vδTbyRoot map[zodb.Oid]*ΔTtail // {} root -> [] k/v change history; only for keys ∈ tracked subset XXX -> byRoot? vδTbyRoot map[zodb.Oid]*ΔTtail // {} root -> [] k/v change history; only for keys ∈ tracked subset XXX -> byRoot?
// set of tracked nodes as of @head state. // set of tracked nodes as of @head state.
...@@ -125,10 +125,10 @@ type ΔTtail struct { ...@@ -125,10 +125,10 @@ type ΔTtail struct {
lastRevOf map[Key]zodb.Tid // {} key -> last lastRevOf map[Key]zodb.Tid // {} key -> last
} }
// ΔBroots represents roots-only part of ΔB. // _ΔBroots represents roots-only part of ΔB.
// //
// It describes which trees were changed, but does not provide δkv details for changed trees. // It describes which trees were changed, but does not provide δkv details for changed trees.
type ΔBroots struct { type _ΔBroots struct {
Rev zodb.Tid Rev zodb.Tid
ΔRoots setOid // which roots changed in this revision ΔRoots setOid // which roots changed in this revision
} }
...@@ -185,9 +185,9 @@ func (orig *ΔBtail) Clone() *ΔBtail { ...@@ -185,9 +185,9 @@ func (orig *ΔBtail) Clone() *ΔBtail {
} }
// vδBroots // vδBroots
klon.vδBroots = make([]ΔBroots, 0, len(orig.vδBroots)) klon.vδBroots = make([]_ΔBroots, 0, len(orig.vδBroots))
for _, origδBroots := range orig.vδBroots { for _, origδBroots := range orig.vδBroots {
klonδBroots := ΔBroots{ klonδBroots := _ΔBroots{
Rev: origδBroots.Rev, Rev: origδBroots.Rev,
ΔRoots: origδBroots.ΔRoots.Clone(), ΔRoots: origδBroots.ΔRoots.Clone(),
} }
...@@ -599,7 +599,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -599,7 +599,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
for root := range δB.ΔByRoot { for root := range δB.ΔByRoot {
δroots.Add(root) δroots.Add(root)
} }
δBtail.vδBroots = append(δBtail.vδBroots, ΔBroots{Rev: δB.Rev, ΔRoots: δroots}) δBtail.vδBroots = append(δBtail.vδBroots, _ΔBroots{Rev: δB.Rev, ΔRoots: δroots})
return δB, err return δB, err
} }
...@@ -690,10 +690,10 @@ func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) { ...@@ -690,10 +690,10 @@ func (δBtail *ΔBtail) vδBroots_Update(root zodb.Oid, δrevSet setTid) {
return rev <= δBtail.vδBroots[k].Rev return rev <= δBtail.vδBroots[k].Rev
}) })
if j == l || δBtail.vδBroots[j].Rev != rev { if j == l || δBtail.vδBroots[j].Rev != rev {
δBroots := ΔBroots{Rev: rev, ΔRoots: setOid{}} δBroots := _ΔBroots{Rev: rev, ΔRoots: setOid{}}
// insert(@j, δBroots) // insert(@j, δBroots)
δBtail.vδBroots = append(δBtail.vδBroots[:j], δBtail.vδBroots = append(δBtail.vδBroots[:j],
append([]ΔBroots{δBroots}, append([]_ΔBroots{δBroots},
δBtail.vδBroots[j:]...)...) δBtail.vδBroots[j:]...)...)
} }
δBroots := δBtail.vδBroots[j] δBroots := δBtail.vδBroots[j]
...@@ -720,7 +720,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) { ...@@ -720,7 +720,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
} }
// vδBroots[:icut] should be forgotten // vδBroots[:icut] should be forgotten
δBtail.vδBroots = append([]ΔBroots(nil), δBtail.vδBroots[icut:]...) δBtail.vδBroots = append([]_ΔBroots(nil), δBtail.vδBroots[icut:]...)
// trim roots // trim roots
for root := range totrim { for root := range totrim {
......
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