Commit c21de4a4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d2bb8d78
......@@ -293,7 +293,6 @@ func (orig *ΔBtail) clone() *ΔBtail {
return klon
}
/*
// newΔTtail creates new empty ΔTtail object.
func newΔTtail() *ΔTtail {
return &ΔTtail{
......@@ -301,7 +300,6 @@ func newΔTtail() *ΔTtail {
lastRevOf: make(map[Key]zodb.Tid),
}
}
*/
// (tail, head] coverage
func (δBtail *ΔBtail) Head() zodb.Tid { return δBtail.δZtail.Head() }
......@@ -325,7 +323,7 @@ func (δBtail *ΔBtail) Tail() zodb.Tid { return δBtail.δZtail.Tail() }
//
// XXX catch cycles on add?
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()
pathv := []string{}
......@@ -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 lastRevOf
......@@ -445,16 +437,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δTtail, ok := δBtail.byRoot[root]
if !ok {
// this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
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: ...,
}
δTtail = newΔTtail()
δBtail.byRoot[root] = δTtail
}
......@@ -550,17 +533,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δTtail, ok := δBtail.byRoot[root]
if !ok {
// this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
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: ...,
}
δTtail = newΔ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