clang-tidy: convert to all/any_of
Found with readability-use-anyofallof Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -429,29 +429,27 @@ SongFilter::Match(const LightSong &song) const noexcept
|
||||
bool
|
||||
SongFilter::HasFoldCase() const noexcept
|
||||
{
|
||||
for (const auto &i : and_filter.GetItems()) {
|
||||
if (auto t = dynamic_cast<const TagSongFilter *>(i.get())) {
|
||||
if (t->GetFoldCase())
|
||||
return true;
|
||||
} else if (auto u = dynamic_cast<const UriSongFilter *>(i.get())) {
|
||||
if (u->GetFoldCase())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return std::any_of(
|
||||
and_filter.GetItems().begin(), and_filter.GetItems().end(),
|
||||
[](const auto &item) {
|
||||
if (auto t = dynamic_cast<const TagSongFilter *>(item.get()))
|
||||
return t->GetFoldCase();
|
||||
|
||||
return false;
|
||||
if (auto u = dynamic_cast<const UriSongFilter *>(item.get()))
|
||||
return u->GetFoldCase();
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
bool
|
||||
SongFilter::HasOtherThanBase() const noexcept
|
||||
{
|
||||
for (const auto &i : and_filter.GetItems()) {
|
||||
const auto *f = dynamic_cast<const BaseSongFilter *>(i.get());
|
||||
if (f == nullptr)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return std::any_of(and_filter.GetItems().begin(), and_filter.GetItems().end(),
|
||||
[=](const auto &item) {
|
||||
return !dynamic_cast<const BaseSongFilter *>(
|
||||
item.get());
|
||||
});
|
||||
}
|
||||
|
||||
const char *
|
||||
|
||||
Reference in New Issue
Block a user