Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
b
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
b
Commits
713e5439
Commit
713e5439
authored
Apr 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a8a50795
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
all_test.go
all_test.go
+1
-1
btree.go
btree.go
+3
-3
No files found.
all_test.go
View file @
713e5439
...
...
@@ -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
consistenc
y
// it can be used after Set/Put/Delete to verify
that all hit parameters were calculated correctl
y
func
(
t
*
Tree
)
checkHit
(
k
interface
{}
/*K*/
,
op
treeOp
)
{
wrong
:=
false
bad
:=
func
(
s
string
,
va
...
interface
{})
{
...
...
btree.go
View file @
713e5439
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment