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
a727ee64
Commit
a727ee64
authored
Apr 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2720e9af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
btree.go
btree.go
+7
-6
No files found.
btree.go
View file @
a727ee64
...
@@ -736,11 +736,13 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
...
@@ -736,11 +736,13 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
// - need to do the usual scan from root to split index pages.
// - need to do the usual scan from root to split index pages.
default
:
default
:
p
,
pi
:=
t
.
hitP
,
t
.
hitPi
p
,
pi
:=
t
.
hitP
,
t
.
hitPi
if
p
==
nil
||
p
.
c
<=
2
*
kx
{
if
p
!=
nil
&&
p
.
c
>
2
*
kx
{
// XXX note on overflow corrects what
break
t
.
overflow
(
p
,
dd
,
pi
,
i
,
k
,
v
)
return
}
}
// NOTE overflow corrects hit Kmin, Kmax and Pi as needed
t
.
overflow
(
p
,
dd
,
pi
,
i
,
k
,
v
)
return
}
}
}
}
...
@@ -800,7 +802,6 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
...
@@ -800,7 +802,6 @@ func (t *Tree) Set(k interface{} /*K*/, v interface{} /*V*/) {
default
:
default
:
// NOTE overflow corrects hit Kmin, Kmax and Pi as needed
// NOTE overflow corrects hit Kmin, Kmax and Pi as needed
// XXX if split
t
.
overflow
(
p
,
x
,
pi
,
i
,
k
,
v
)
t
.
overflow
(
p
,
x
,
pi
,
i
,
k
,
v
)
}
}
...
@@ -929,7 +930,7 @@ func (t *Tree) split(p *x, q *d, pi, i int, k interface{} /*K*/, v interface{} /
...
@@ -929,7 +930,7 @@ func (t *Tree) split(p *x, q *d, pi, i int, k interface{} /*K*/, v interface{} /
if
i
>
kd
{
if
i
>
kd
{
t
.
insert
(
r
,
i
-
kd
,
k
,
v
)
t
.
insert
(
r
,
i
-
kd
,
k
,
v
)
t
.
hitKmin
.
set
(
p
.
x
[
pi
]
.
k
)
t
.
hitKmin
.
set
(
p
.
x
[
pi
]
.
k
)
t
.
hitKmax
:
=
t
.
hitPKmax
t
.
hitKmax
=
t
.
hitPKmax
if
pi
+
1
<
p
.
c
{
// k=+∞ @p.c
if
pi
+
1
<
p
.
c
{
// k=+∞ @p.c
t
.
hitKmax
.
set
(
p
.
x
[
pi
+
1
]
.
k
)
t
.
hitKmax
.
set
(
p
.
x
[
pi
+
1
]
.
k
)
}
}
...
...
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