Commit 476742f8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1ae40c93
...@@ -857,6 +857,7 @@ func (δBtail *ΔBtail) rebuild() (err error) { ...@@ -857,6 +857,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
// go backwards and merge vδT <- treediff(lo..hi/trackNew) // go backwards and merge vδT <- treediff(lo..hi/trackNew)
vδZ := δBtail.δZtail.Data() vδZ := δBtail.δZtail.Data()
vδtrack := []*δtrackIndex{}
for i := len(vδZ)-1; i>=0; i-- { for i := len(vδZ)-1; i>=0; i-- {
δZ := vδZ[i] δZ := vδZ[i]
...@@ -904,6 +905,7 @@ func (δBtail *ΔBtail) rebuild() (err error) { ...@@ -904,6 +905,7 @@ func (δBtail *ΔBtail) rebuild() (err error) {
tracef("-> root<%s> δkv*: %v δtrack*: %v\n", root, δT, δtrack) tracef("-> root<%s> δkv*: %v δtrack*: %v\n", root, δT, δtrack)
trackNew.ApplyΔ(δtrack) trackNew.ApplyΔ(δtrack)
vδtrack = append([]*δtrackIndex{δtrack}, vδtrack...)
if len(δT) == 0 { // an object might be resaved without change if len(δT) == 0 { // an object might be resaved without change
continue continue
...@@ -945,11 +947,11 @@ func (δBtail *ΔBtail) rebuild() (err error) { ...@@ -945,11 +947,11 @@ func (δBtail *ΔBtail) rebuild() (err error) {
} }
} }
// merge trackNew into .trackIdx // trackNew was adjusted to correspond to @tail. Map it back to @head and merge to .trackIdx
// FIXME here trackNew was adjusted to correspond to @tail for _, δtrack := range vδtrack {
// FIXME -> we have to map it back to correspond to @head before merge δtrack.Reverse() // we saved it as lo<-hi; now we go lo->hi
// trackNew.ApplyΔ(δtrack)
// TODO -> remember δtracks from treediff; reverse them and apply them back in reverse order. }
δBtail.trackIdx.UnionInplace(trackNew) δBtail.trackIdx.UnionInplace(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