Commit 67bc4254 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c5217263
...@@ -308,6 +308,7 @@ func (t *Tree) catX(p, q, r *x, pi int) { ...@@ -308,6 +308,7 @@ func (t *Tree) catX(p, q, r *x, pi int) {
// true. // true.
func (t *Tree) Delete(k interface{} /*K*/) (ok bool) { func (t *Tree) Delete(k interface{} /*K*/) (ok bool) {
//dbg("--- PRE Delete(%v)\n%s", k, t.dump()) //dbg("--- PRE Delete(%v)\n%s", k, t.dump())
defer t.checkHit(k)
//defer func() { //defer func() {
// dbg("--- POST\n%s\n====\n", t.dump()) // dbg("--- POST\n%s\n====\n", t.dump())
//}() //}()
...@@ -686,21 +687,20 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) { ...@@ -686,21 +687,20 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
//hitPKmax = hitKmax //hitPKmax = hitKmax
if x.c > 2*kx { if x.c > 2*kx {
//x, i = t.splitX(p, x, pi, i)
//dbg("splitX") //dbg("splitX")
x, i, p, pi = t.splitX(p, x, pi, i) x, i, p, pi = t.splitX(p, x, pi, i)
// NOTE splitX changes p which means hit // NOTE splitX changes p which means hit
// Kmin/Kmax/PKmax have to be recomputed // Kmin/Kmax/PKmax have to be recomputed
if pi >= 0 && pi < p.c { if pi >= 0 && pi < p.c {
hitPKmax.set(p.x[pi].k) // XXX wrong vs oo and not oo above hitPKmax.set(p.x[pi].k)
//dbg("hitPKmax X: %v", hitPKmax) //dbg("hitPKmax X: %v", hitPKmax)
hitKmax = hitPKmax hitKmax = hitPKmax
//dbg("hitKmax X: %v", hitKmax) //dbg("hitKmax X: %v", hitKmax)
} }
if pi > 0 { if pi > 0 {
hitKmin.set(p.x[pi-1].k) // XXX also recheck vs above hitKmin.set(p.x[pi-1].k)
//dbg("hitKmin X: %v", hitKmin) //dbg("hitKmin X: %v", hitKmin)
} }
} else { } else {
......
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