Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-ds-leveldb
Commits
9978dc41
Commit
9978dc41
authored
Jan 09, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Query.KeysOnly
parent
e79d8609
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
datastore.go
datastore.go
+10
-6
No files found.
datastore.go
View file @
9978dc41
...
...
@@ -81,13 +81,17 @@ func (d *datastore) Query(q dsq.Query) (*dsq.Results, error) {
var
es
[]
dsq
.
Entry
for
i
.
Next
()
{
cpy
:=
make
([]
byte
,
len
(
i
.
Value
()))
copy
(
cpy
,
i
.
Value
())
es
=
append
(
es
,
dsq
.
Entry
{
Key
:
ds
.
NewKey
(
string
(
i
.
Key
()))
.
String
(),
Value
:
cpy
,
})
k
:=
ds
.
NewKey
(
string
(
i
.
Key
()))
.
String
()
e
:=
dsq
.
Entry
{
Key
:
k
}
if
!
q
.
KeysOnly
{
buf
:=
make
([]
byte
,
len
(
i
.
Value
()))
copy
(
buf
,
i
.
Value
())
e
.
Value
=
buf
}
es
=
append
(
es
,
e
)
}
i
.
Release
()
if
err
:=
i
.
Error
();
err
!=
nil
{
...
...
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