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
d5e0d49f
Commit
d5e0d49f
authored
Nov 07, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
song/{Tag,Uri}SongFilter: pass `StringFilter&&` to constructor
parent
73b22d82
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
25 deletions
+15
-25
Filter.cxx
src/song/Filter.cxx
+11
-14
TagSongFilter.hxx
src/song/TagSongFilter.hxx
+2
-6
UriSongFilter.hxx
src/song/UriSongFilter.hxx
+2
-5
No files found.
src/song/Filter.cxx
View file @
d5e0d49f
...
...
@@ -93,9 +93,8 @@ SongFilter::SongFilter(TagType tag, const char *value, bool fold_case)
{
/* for compatibility with MPD 0.20 and older, "fold_case" also
switches on "substring" */
and_filter
.
AddItem
(
std
::
make_unique
<
TagSongFilter
>
(
tag
,
value
,
fold_case
,
fold_case
,
false
));
and_filter
.
AddItem
(
std
::
make_unique
<
TagSongFilter
>
(
tag
,
StringFilter
(
value
,
fold_case
,
fold_case
,
false
)));
}
SongFilter
::~
SongFilter
()
...
...
@@ -293,19 +292,17 @@ SongFilter::ParseExpression(const char *&s, bool fold_case)
s
=
StripLeft
(
s
+
1
);
StringFilter
string_filter
(
std
::
move
(
value
),
fold_case
,
false
,
negated
);
if
(
type
==
LOCATE_TAG_ANY_TYPE
)
type
=
TAG_NUM_OF_ITEM_TYPES
;
if
(
type
==
LOCATE_TAG_FILE_TYPE
)
return
std
::
make_unique
<
UriSongFilter
>
(
std
::
move
(
value
),
fold_case
,
false
,
negated
);
return
std
::
make_unique
<
UriSongFilter
>
(
std
::
move
(
string_filter
));
return
std
::
make_unique
<
TagSongFilter
>
(
TagType
(
type
),
std
::
move
(
value
),
fold_case
,
false
,
negated
);
std
::
move
(
string_filter
));
}
}
...
...
@@ -332,10 +329,10 @@ SongFilter::Parse(const char *tag_string, const char *value, bool fold_case)
case
LOCATE_TAG_FILE_TYPE
:
/* for compatibility with MPD 0.20 and older,
"fold_case" also switches on "substring" */
and_filter
.
AddItem
(
std
::
make_unique
<
UriSongFilter
>
(
value
,
and_filter
.
AddItem
(
std
::
make_unique
<
UriSongFilter
>
(
StringFilter
(
value
,
fold_case
,
fold_case
,
false
));
false
)
));
break
;
default
:
...
...
@@ -345,10 +342,10 @@ SongFilter::Parse(const char *tag_string, const char *value, bool fold_case)
/* for compatibility with MPD 0.20 and older,
"fold_case" also switches on "substring" */
and_filter
.
AddItem
(
std
::
make_unique
<
TagSongFilter
>
(
TagType
(
tag
),
value
,
StringFilter
(
value
,
fold_case
,
fold_case
,
false
));
false
)
));
break
;
}
}
...
...
src/song/TagSongFilter.hxx
View file @
d5e0d49f
...
...
@@ -37,12 +37,8 @@ class TagSongFilter final : public ISongFilter {
StringFilter
filter
;
public
:
template
<
typename
V
>
TagSongFilter
(
TagType
_type
,
V
&&
_value
,
bool
fold_case
,
bool
substring
,
bool
negated
)
:
type
(
_type
),
filter
(
std
::
forward
<
V
>
(
_value
),
fold_case
,
substring
,
negated
)
{}
TagSongFilter
(
TagType
_type
,
StringFilter
&&
_filter
)
noexcept
:
type
(
_type
),
filter
(
std
::
move
(
_filter
))
{}
TagType
GetTagType
()
const
{
return
type
;
...
...
src/song/UriSongFilter.hxx
View file @
d5e0d49f
...
...
@@ -27,11 +27,8 @@ class UriSongFilter final : public ISongFilter {
StringFilter
filter
;
public
:
template
<
typename
V
>
UriSongFilter
(
V
&&
_value
,
bool
fold_case
,
bool
substring
,
bool
negated
)
:
filter
(
std
::
forward
<
V
>
(
_value
),
fold_case
,
substring
,
negated
)
{}
UriSongFilter
(
StringFilter
&&
_filter
)
noexcept
:
filter
(
std
::
move
(
_filter
))
{}
const
auto
&
GetValue
()
const
noexcept
{
return
filter
.
GetValue
();
...
...
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