Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
15b2a486
Commit
15b2a486
authored
Sep 02, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protocol/RangeArg: add Contains()
parent
2915d2dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+1
-3
RangeArg.hxx
src/protocol/RangeArg.hxx
+4
-0
No files found.
src/db/DatabasePrint.cxx
View file @
15b2a486
...
...
@@ -202,9 +202,7 @@ db_selection_print(Response &r, Partition &partition,
if
(
sort
==
TAG_NUM_OF_ITEM_TYPES
)
{
if
(
!
window
.
IsAll
())
s
=
[
s
,
window
,
&
i
](
const
LightSong
&
song
){
const
bool
in_window
=
i
>=
window
.
start
&&
i
<
window
.
end
;
++
i
;
if
(
in_window
)
if
(
window
.
Contains
(
i
++
))
s
(
song
);
};
...
...
src/protocol/RangeArg.hxx
View file @
15b2a486
...
...
@@ -42,6 +42,10 @@ struct RangeArg {
constexpr
bool
IsAll
()
const
noexcept
{
return
*
this
==
All
();
}
constexpr
bool
Contains
(
unsigned
i
)
const
noexcept
{
return
i
>=
start
&&
i
<
end
;
}
};
#endif
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