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
b1c3915a
Commit
b1c3915a
authored
Apr 13, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d40c9c54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
all_test.go
all_test.go
+4
-1
btree.go
btree.go
+12
-0
No files found.
all_test.go
View file @
b1c3915a
...
...
@@ -216,7 +216,10 @@ loop:
case
*
d
:
switch
op
{
case
opGet
:
panic
(
"TODO"
)
// tried to search for key > max k in x
if
!
ok
&&
i
>=
x
.
c
{
i
=
x
.
c
-
1
}
case
opSet
:
if
!
ok
{
...
...
btree.go
View file @
b1c3915a
...
...
@@ -862,6 +862,10 @@ func (t *Tree) Put(k interface{} /*K*/, upd func(oldV interface{} /*V*/, exists
t
.
insert
(
dd
,
i
,
k
,
newV
)
}
else
{
t
.
hitDi
=
i
// if it was only Get landed past max key - adjust it to valid entry
if
t
.
hitDi
>=
dd
.
c
{
t
.
hitDi
--
}
}
return
...
...
@@ -881,6 +885,10 @@ func (t *Tree) Put(k interface{} /*K*/, upd func(oldV interface{} /*V*/, exists
t
.
overflow
(
p
,
dd
,
pi
,
i
,
k
,
newV
)
}
else
{
t
.
hitDi
=
i
// see about "valid entry" ^^^
if
t
.
hitDi
>=
dd
.
c
{
t
.
hitDi
--
}
}
return
}
...
...
@@ -937,6 +945,10 @@ func (t *Tree) Put(k interface{} /*K*/, upd func(oldV interface{} /*V*/, exists
if
!
written
{
t
.
hitD
,
t
.
hitDi
=
x
,
i
// see about "valid entry" ^^^
if
t
.
hitDi
>=
x
.
c
{
t
.
hitDi
--
}
break
}
...
...
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