Commit 2310a8d0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e3d1d90e
...@@ -300,20 +300,6 @@ func (rbs RBucketSet) coverage() string { ...@@ -300,20 +300,6 @@ func (rbs RBucketSet) coverage() string {
return s return s
} }
/* XXX kill
// holeIdx returns what should be ΔBtree.holeIdx for specified tracked key set.
func (rbs RBucketSet) holeIdx(tracked SetKey) SetKey {
holes := SetKey{}
for k := range tracked {
_, keyin := rbs.Get(k).kv[k]
if !keyin {
holes.Add(k)
}
}
return holes
}
*/
// trackSet returns what should be ΔBtree.trackSet for specified tracked key set. // trackSet returns what should be ΔBtree.trackSet for specified tracked key set.
func (rbs RBucketSet) trackSet(tracked SetKey) PPTreeSubSet { func (rbs RBucketSet) trackSet(tracked SetKey) PPTreeSubSet {
trackSet := PPTreeSubSet{} trackSet := PPTreeSubSet{}
...@@ -541,69 +527,6 @@ func KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) { ...@@ -541,69 +527,6 @@ func KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
return kadj12 return kadj12
} }
// XXX kill after holeIdx removal
func _KAdj_old(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
var keys SetKey
switch len(keysv) {
case 0:
keys = allTestKeys(t1, t2)
case 1:
keys = keysv[0]
default:
panic("multiple key sets on the call")
}
// kadj = {} k -> adjacent keys.
// if k is tracked -> changes to adjacents must be in Update(t1->t2).
kadj = KAdjMatrix{}
for k := range keys {
adj1 := SetKey{}
adj2 := SetKey{}
q1 := []Key{k}
q2 := []Key{k}
//tracef("\n")
for len(q1) > 0 || len(q2) > 0 {
//tracef("q1: %v\n", q1)
//tracef("q2: %v\n", q2)
if l1 := len(q1); l1 > 0 {
k1 := q1[l1-1]; q1 = q1[:l1-1]
if !adj1.Has(k1) {
for k_ := range t1.xkv.Get(k1).kv {
adj1.Add(k_)
for k__ := range t2.xkv.Get(k_).kv {
if !adj2.Has(k__) {
q2 = append(q2, k__)
}
}
}
}
}
if l2 := len(q2); l2 > 0 {
k2 := q2[l2-1]; q2 = q2[:l2-1]
if !adj2.Has(k2) {
for k_ := range t2.xkv.Get(k2).kv {
adj2.Add(k_)
for k__ := range t1.xkv.Get(k_).kv {
if !adj1.Has(k__) {
q1 = append(q1, k__)
}
}
}
}
}
}
adj := SetKey{}; adj.Add(k); adj.Update(adj1); adj.Update(adj2)
kadj[k] = adj
}
return kadj
}
const debugKAdj = false const debugKAdj = false
func debugfKAdj(format string, argv ...interface{}) { func debugfKAdj(format string, argv ...interface{}) {
if debugKAdj { if debugKAdj {
...@@ -705,7 +628,7 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) { ...@@ -705,7 +628,7 @@ func _KAdj(t1, t2 *tTreeCommit, keysv ...SetKey) (kadj KAdjMatrix) {
q2.Clear() q2.Clear()
} }
adj := SetKey{}; adj.Add(k); adj.Update(adj1); adj.Update(adj2) // XXX kill Add(k) adj := SetKey{}; adj.Update(adj1); adj.Update(adj2)
kadj[k] = adj kadj[k] = adj
} }
......
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