db/Selection: refactor IsEmpty() to IsFiltered()

This commit is contained in:
Max Kellermann 2022-02-14 09:16:02 +01:00
parent af3a625f64
commit edbaea8df2
3 changed files with 4 additions and 4 deletions

View File

@ -34,9 +34,9 @@ DatabaseSelection::DatabaseSelection(const char *_uri, bool _recursive,
}
bool
DatabaseSelection::IsEmpty() const noexcept
DatabaseSelection::IsFiltered() const noexcept
{
return uri.empty() && (filter == nullptr || filter->IsEmpty());
return !uri.empty() || (filter != nullptr && !filter->IsEmpty());
}
bool

View File

@ -60,7 +60,7 @@ struct DatabaseSelection {
const SongFilter *_filter=nullptr) noexcept;
[[gnu::pure]]
bool IsEmpty() const noexcept;
bool IsFiltered() const noexcept;
/**
* Does this selection contain constraints other than "base"?

View File

@ -992,7 +992,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
visit_song);
if (!visit_directory && !visit_playlist && selection.recursive &&
!selection.IsEmpty()) {
selection.IsFiltered()) {
/* this optimized code path can only be used under
certain conditions */
::SearchSongs(connection, selection, visit_song);