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
8332deee
Commit
8332deee
authored
Apr 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
22a81b26
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
btree.go
btree.go
+4
-4
No files found.
btree.go
View file @
8332deee
...
...
@@ -492,7 +492,7 @@ func (t *Tree) find(q interface{}, k interface{} /*K*/) (i int, ok bool) {
return
l
,
false
}
// same as find but when we pre-know range to search and for data-page only
//
find2 is the
same as find but when we pre-know range to search and for data-page only
func
(
t
*
Tree
)
find2
(
d
*
d
,
k
interface
{}
/*K*/
,
l
,
h
int
)
(
i
int
,
ok
bool
)
{
for
l
<=
h
{
m
:=
(
l
+
h
)
>>
1
...
...
@@ -509,13 +509,13 @@ func (t *Tree) find2(d *d, k interface{} /*K*/, l, h int) (i int, ok bool) {
return
l
,
false
}
// hitFind returns
k position in previo
sly hit data page
// hitFind returns
position for k in previou
sly hit data page
// if k should not reside in hit range: -1, false is returned
// oth
re
wise returns are:
// oth
er
wise returns are:
// - i: index corresponding to data entry in t.hitD with min(k' : k <= k')
// - ok: whether k' == k
func
(
t
*
Tree
)
hitFind
(
k
interface
{}
/*K*/
)
(
i
int
,
ok
bool
)
{
//
XXX reenable
to test how slow path computes hit{Kmin,Kmax} on all keys
//
DEBUG: enable this
to test how slow path computes hit{Kmin,Kmax} on all keys
//return -1, false
hit
:=
t
.
hitD
...
...
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