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-datastore
Commits
ec27f419
Commit
ec27f419
authored
Feb 10, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: avoid filtering by prefix unless necessary
There's no need to filter by the / prefix.
parent
b72ac7e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
query/query_impl.go
query/query_impl.go
+2
-4
No files found.
query/query_impl.go
View file @
ec27f419
...
...
@@ -129,12 +129,10 @@ func NaiveQueryApply(q Query, qr Results) Results {
}
prefix
=
path
.
Clean
(
prefix
)
}
// If the prefix isn't "/", end it in a "/" so we only find keys
// _under_ the prefix.
// If the prefix is empty, ignore it.
if
prefix
!=
"/"
{
prefix
+
=
"/"
qr
=
NaiveFilter
(
qr
,
FilterKeyPrefix
{
prefix
+
"/"
})
}
qr
=
NaiveFilter
(
qr
,
FilterKeyPrefix
{
prefix
})
}
for
_
,
f
:=
range
q
.
Filters
{
qr
=
NaiveFilter
(
qr
,
f
)
...
...
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