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
0b8208fe
Commit
0b8208fe
authored
Nov 04, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'clng11' of
git://github.com/neheb/MPD
into master
parents
3d276d50
f1fc5d79
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
32 deletions
+22
-32
FileCommands.cxx
src/command/FileCommands.cxx
+3
-6
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+5
-10
Filter.cxx
src/song/Filter.cxx
+14
-16
No files found.
src/command/FileCommands.cxx
View file @
0b8208fe
...
@@ -113,12 +113,9 @@ IsValidName(const StringView s) noexcept
...
@@ -113,12 +113,9 @@ IsValidName(const StringView s) noexcept
if
(
s
.
empty
()
||
!
IsAlphaASCII
(
s
.
front
()))
if
(
s
.
empty
()
||
!
IsAlphaASCII
(
s
.
front
()))
return
false
;
return
false
;
for
(
const
char
ch
:
s
)
{
return
std
::
none_of
(
s
.
begin
(),
s
.
end
(),
[
=
](
const
auto
&
ch
)
{
if
(
!
IsAlphaASCII
(
ch
)
&&
ch
!=
'_'
&&
ch
!=
'-'
)
return
!
IsAlphaASCII
(
ch
)
&&
ch
!=
'_'
&&
ch
!=
'-'
;
return
false
;
});
}
return
true
;
}
}
gcc_pure
gcc_pure
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
0b8208fe
...
@@ -356,11 +356,9 @@ SendConstraints(mpd_connection *connection, const SongFilter &filter)
...
@@ -356,11 +356,9 @@ SendConstraints(mpd_connection *connection, const SongFilter &filter)
filter
.
ToExpression
().
c_str
());
filter
.
ToExpression
().
c_str
());
#endif
#endif
for
(
const
auto
&
i
:
filter
.
GetItems
())
return
std
::
all_of
(
if
(
!
SendConstraints
(
connection
,
*
i
))
filter
.
GetItems
().
begin
(),
filter
.
GetItems
().
end
(),
return
false
;
[
=
](
const
auto
&
item
)
{
return
SendConstraints
(
connection
,
*
item
);
});
return
true
;
}
}
static
bool
static
bool
...
@@ -896,11 +894,8 @@ IsFilterFullySupported(const SongFilter &filter,
...
@@ -896,11 +894,8 @@ IsFilterFullySupported(const SongFilter &filter,
(
void
)
connection
;
(
void
)
connection
;
#endif
#endif
for
(
const
auto
&
i
:
filter
.
GetItems
())
return
std
::
all_of
(
filter
.
GetItems
().
begin
(),
filter
.
GetItems
().
end
(),
if
(
!
IsFilterSupported
(
*
i
))
[](
const
auto
&
item
)
{
return
IsFilterSupported
(
*
item
);
});
return
false
;
return
true
;
}
}
gcc_pure
gcc_pure
...
...
src/song/Filter.cxx
View file @
0b8208fe
...
@@ -429,29 +429,27 @@ SongFilter::Match(const LightSong &song) const noexcept
...
@@ -429,29 +429,27 @@ SongFilter::Match(const LightSong &song) const noexcept
bool
bool
SongFilter
::
HasFoldCase
()
const
noexcept
SongFilter
::
HasFoldCase
()
const
noexcept
{
{
for
(
const
auto
&
i
:
and_filter
.
GetItems
())
{
return
std
::
any_of
(
if
(
auto
t
=
dynamic_cast
<
const
TagSongFilter
*>
(
i
.
get
()))
{
and_filter
.
GetItems
().
begin
(),
and_filter
.
GetItems
().
end
(),
if
(
t
->
GetFoldCase
())
[](
const
auto
&
item
)
{
return
true
;
if
(
auto
t
=
dynamic_cast
<
const
TagSongFilter
*>
(
item
.
get
()))
}
else
if
(
auto
u
=
dynamic_cast
<
const
UriSongFilter
*>
(
i
.
get
()))
{
return
t
->
GetFoldCase
();
if
(
u
->
GetFoldCase
())
return
true
;
if
(
auto
u
=
dynamic_cast
<
const
UriSongFilter
*>
(
item
.
get
()))
}
return
u
->
GetFoldCase
();
}
return
false
;
return
false
;
});
}
}
bool
bool
SongFilter
::
HasOtherThanBase
()
const
noexcept
SongFilter
::
HasOtherThanBase
()
const
noexcept
{
{
for
(
const
auto
&
i
:
and_filter
.
GetItems
())
{
return
std
::
any_of
(
and_filter
.
GetItems
().
begin
(),
and_filter
.
GetItems
().
end
(),
const
auto
*
f
=
dynamic_cast
<
const
BaseSongFilter
*>
(
i
.
get
());
[
=
](
const
auto
&
item
)
{
if
(
f
==
nullptr
)
return
!
dynamic_cast
<
const
BaseSongFilter
*>
(
return
true
;
item
.
get
());
}
});
return
false
;
}
}
const
char
*
const
char
*
...
...
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