Commit f81aa6f8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 45aca963
......@@ -690,8 +690,8 @@ func (δBtail *ΔBtail) rebuild() (err error) {
if !ok {
// this root was not tracked before -> create δTtail for it with empty changes
var vδT []ΔTree
for i := 0; i < len(vδZ); i++ {
vδT = append(vδT, ΔTree{Rev: vδZ[i].Rev, ΔKV: make(map[Key]ΔValue)})
for j := 0; j < len(vδZ); j++ {
vδT = append(vδT, ΔTree{Rev: vδZ[j].Rev, ΔKV: make(map[Key]ΔValue)})
}
δTtail = &ΔTtail{
vδT: vδT,
......@@ -785,12 +785,24 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
if len(δT) > 0 { // an object might be resaved without change
δB.ByRoot[root] = δT
δTtail, ok := δBtail.byRoot[root]
if !ok {
// this root was not tracked before ... XXX
δTtail = &ΔTtail {
// XXX vδT: ...
// XXX KVAtTail: ...,
// XXX lastRevOf: ...,
}
δBtail.byRoot[root] = δTtail
}
δTtail.vδT = append(δTtail.vδT, ΔTree{Rev: δZ.Tid, ΔKV: δT})
// XXX rebuild KVAtTail
// XXX rebuild lastRevOf
}
}
// XXX .δBtail <- (δZ.rev, [](root, []key))
// XXX rebuild lastRevOf
return δB, 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