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
3bddfd4e
Commit
3bddfd4e
authored
Apr 12, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aa6b1d21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
btree.go
btree.go
+2
-1
No files found.
btree.go
View file @
3bddfd4e
...
@@ -519,7 +519,7 @@ func (t *Tree) find2(d *d, k interface{} /*K*/, l, h int) (i int, ok bool) {
...
@@ -519,7 +519,7 @@ func (t *Tree) find2(d *d, k interface{} /*K*/, l, h int) (i int, ok bool) {
// hitFind returns k position in previosly hit data page
// hitFind returns k position in previosly hit data page
// if k should not reside in hit range: -1, false is returned
// if k should not reside in hit range: -1, false is returned
// othrewise returns are:
// othrewise returns are:
// - i: index corresponding to data entry in t.hitD with min(k' : k
' >= k
)
// - i: index corresponding to data entry in t.hitD with min(k' : k
<= k'
)
// - ok: whether k' == k
// - ok: whether k' == k
func
(
t
*
Tree
)
hitFind
(
k
interface
{}
/*K*/
)
(
i
int
,
ok
bool
)
{
func
(
t
*
Tree
)
hitFind
(
k
interface
{}
/*K*/
)
(
i
int
,
ok
bool
)
{
hit
:=
t
.
hitD
hit
:=
t
.
hitD
...
@@ -776,6 +776,7 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
...
@@ -776,6 +776,7 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
//dbg("splitX")
//dbg("splitX")
x
,
i
,
p
,
pi
=
t
.
splitX
(
p
,
x
,
pi
,
i
)
x
,
i
,
p
,
pi
=
t
.
splitX
(
p
,
x
,
pi
,
i
)
// FIXME move logic inside splitX
// 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
{
...
...
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