Commit c21de4a4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d2bb8d78
...@@ -293,7 +293,6 @@ func (orig *ΔBtail) clone() *ΔBtail { ...@@ -293,7 +293,6 @@ func (orig *ΔBtail) clone() *ΔBtail {
return klon return klon
} }
/*
// newΔTtail creates new empty ΔTtail object. // newΔTtail creates new empty ΔTtail object.
func newΔTtail() *ΔTtail { func newΔTtail() *ΔTtail {
return &ΔTtail{ return &ΔTtail{
...@@ -301,7 +300,6 @@ func newΔTtail() *ΔTtail { ...@@ -301,7 +300,6 @@ func newΔTtail() *ΔTtail {
lastRevOf: make(map[Key]zodb.Tid), lastRevOf: make(map[Key]zodb.Tid),
} }
} }
*/
// (tail, head] coverage // (tail, head] coverage
func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() } func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() }
...@@ -325,7 +323,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() } ...@@ -325,7 +323,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
// //
// XXX catch cycles on add? // XXX catch cycles on add?
func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { // XXX Tree|Bucket; path[0] = root func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { // XXX Tree|Bucket; path[0] = root
// XXX assert Tree Tree ... Tree Bucket // XXX assert Tree Tree ... Tree Bucket XXX AddNodePath does that
root := path[0].(*Tree).POid() root := path[0].(*Tree).POid()
pathv := []string{} pathv := []string{}
...@@ -352,12 +350,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { // ...@@ -352,12 +350,6 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
} }
} }
/*
_, ok := δBtail.byRoot[root]
if !ok {
δBtail.byRoot[root] = newΔTtail()
}
*/
// XXX update diff XXX here? or as separate step? // XXX update diff XXX here? or as separate step?
// XXX update lastRevOf // XXX update lastRevOf
...@@ -445,16 +437,7 @@ func (δBtail *ΔBtail) rebuild() (err error) { ...@@ -445,16 +437,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δTtail, ok := δBtail.byRoot[root] δTtail, ok := δBtail.byRoot[root]
if !ok { if !ok {
// this root was not tracked before -> create δTtail for it with empty changes // this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ? δTtail = newΔTtail()
var vδT []ΔTree
for _, δZj := range vδZ {
vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)})
}
δTtail = &ΔTtail{
vδT: vδT,
// XXX KVAtTail: ...,
// XXX lastRevOf: ...,
}
δBtail.byRoot[root] = δTtail δBtail.byRoot[root] = δTtail
} }
...@@ -550,17 +533,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -550,17 +533,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δTtail, ok := δBtail.byRoot[root] δTtail, ok := δBtail.byRoot[root]
if !ok { if !ok {
// this root was not tracked before -> create δTtail for it with empty changes // this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ? δTtail = newΔTtail()
var vδT []ΔTree
vδZ := δBtail.δZtail.Data()
for _, δZj := range vδZ[:len(vδZ)-1] {
vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)})
}
δTtail = &ΔTtail {
vδT: vδT,
// XXX KVAtTail: ...,
// XXX lastRevOf: ...,
}
δBtail.byRoot[root] = δTtail δBtail.byRoot[root] = δTtail
} }
......
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