Commit 7ce1eb75 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 10829bb0
......@@ -223,12 +223,12 @@ func TestSetGet0(t *testing.T) {
}
func TestSetGet1(t *testing.T) {
//const N = 40000
const N = 40000
//const N = 21
//const N = 41
const N = 320
//for _, x := range []int{0, -1, 0x555555, 0xaaaaaa, 0x333333, 0xcccccc, 0x314159} {
for _, x := range []int{0x314159} {
//const N = 320
for _, x := range []int{0, -1, 0x555555, 0xaaaaaa, 0x333333, 0xcccccc, 0x314159} {
//for _, x := range []int{0x314159} {
//for _, x := range []int{0} {
r := TreeNew(cmp)
set := r.Set
......
......@@ -670,13 +670,13 @@ func (t *Tree) SeekLast() (e *Enumerator, err error) {
// Set sets the value associated with k.
func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
dbg("--- PRE Set(%v, %v)\t(%v @%d, [%v, %v))\n%s", k, v, t.hit, t.hitIdx, t.hitKmin, t.hitKmax, t.dump())
defer func() {
//if r := recover(); r != nil {
// panic(r)
//}
dbg("--- POST\n%s\n====\n", t.dump())
}()
//dbg("--- PRE Set(%v, %v)\t(%v @%d, [%v, %v))\n%s", k, v, t.hit, t.hitIdx, t.hitKmin, t.hitKmax, t.dump())
//defer func() {
// //if r := recover(); r != nil {
// // panic(r)
// //}
// dbg("--- POST\n%s\n====\n", t.dump())
//}()
// check if we can do the update nearby previous change
i, ok := t.hitFind(k)
......@@ -714,7 +714,7 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
q := t.r
if q == nil {
dbg("empty")
//dbg("empty")
z := t.insert(btDPool.Get().(*d), 0, k, v) // XXX update hit
t.r, t.first, t.last = z, z, z
return
......
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