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
311e0d84
Commit
311e0d84
authored
Apr 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
edd535de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
all_test.go
all_test.go
+13
-6
btree.go
btree.go
+5
-1
No files found.
all_test.go
View file @
311e0d84
...
@@ -204,14 +204,21 @@ loop:
...
@@ -204,14 +204,21 @@ loop:
case
*
d
:
case
*
d
:
switch
{
switch
op
{
case
op
==
opSet
&&
!
ok
:
case
opSet
:
bad
(
"key %v not found after set"
,
k
)
if
!
ok
{
bad
(
"key %v not found after set"
,
k
)
}
case
op
==
opDel
&&
ok
:
case
opDel
:
bad
(
"key %v found after delete"
,
k
)
if
ok
{
bad
(
"key %v found after delete"
,
k
)
}
// XXX adjust i to be in range for opDel
// delted last element or tried to delete element past max k in x
if
i
>=
x
.
c
{
i
=
x
.
c
-
1
}
}
}
dd
=
x
dd
=
x
...
...
btree.go
View file @
311e0d84
...
@@ -323,7 +323,11 @@ func (t *Tree) Delete(k interface{} /*K*/) (ok bool) {
...
@@ -323,7 +323,11 @@ func (t *Tree) Delete(k interface{} /*K*/) (ok bool) {
switch
{
switch
{
case
!
ok
:
case
!
ok
:
dbg
(
"ok'"
)
dbg
(
"ok'"
)
t
.
hitDi
=
i
// XXX ok ? (i > h)
if
i
>=
dd
.
c
{
// tried to delete element past max k in hitD
i
=
dd
.
c
-
1
}
t
.
hitDi
=
i
return
false
return
false
case
dd
.
c
>
kd
:
case
dd
.
c
>
kd
:
...
...
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