db/Selection: refactor IsEmpty() to IsFiltered()
This commit is contained in:
parent
af3a625f64
commit
edbaea8df2
@ -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
|
||||
|
@ -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"?
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user