Commit 713e5439 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a8a50795
......@@ -156,7 +156,7 @@ func opPut(written bool) treeOp {
}
// checkHit rescans t from root and checks that hit D, P, Kmin/Kmax and rest all match what they should
// it can be used after Set/Put/Delete to verify consistency
// it can be used after Set/Put/Delete to verify that all hit parameters were calculated correctly
func (t *Tree) checkHit(k interface{} /*K*/, op treeOp) {
wrong := false
bad := func(s string, va ...interface{}) {
......
......@@ -309,7 +309,7 @@ func (t *Tree) catX(p, q, r *x, pi int) {
// true.
func (t *Tree) Delete(k interface{} /*K*/) (ok bool) {
//dbg("--- PRE Delete(%v)\t; %v @%d, [%v, %v) pk: [%v, %v)\n%s", k, t.hitD, t.hitDi, t.hitKmin, t.hitKmax, t.hitPKmin, t.hitPKmax, t.dump())
defer t.checkHit(k, opDel)
//defer t.checkHit(k, opDel)
//defer func() {
// dbg("--- POST\n%s\n====\n", t.dump())
//}()
......@@ -712,7 +712,7 @@ 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) pk: [%v, %v)\n%s", k, v, t.hitD, t.hitDi, t.hitKmin, t.hitKmax, t.hitPKmin, t.hitPKmax, t.dump())
defer t.checkHit(k, opSet)
//defer t.checkHit(k, opSet)
//defer func() {
// dbg("--- POST\n%s\n====\n", t.dump())
//}()
......@@ -824,7 +824,7 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
//
// modulo the differing return values.
func (t *Tree) Put(k interface{} /*K*/, upd func(oldV interface{} /*V*/, exists bool) (newV interface{} /*V*/, write bool)) (oldV interface{} /*V*/, written bool) {
defer func () { t.checkHit(k, opPut(written)) }()
//defer func () { t.checkHit(k, opPut(written)) }()
pi := -1
var p *x
q := t.r
......
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