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
|
bool
|
||||||
DatabaseSelection::IsEmpty() const noexcept
|
DatabaseSelection::IsFiltered() const noexcept
|
||||||
{
|
{
|
||||||
return uri.empty() && (filter == nullptr || filter->IsEmpty());
|
return !uri.empty() || (filter != nullptr && !filter->IsEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -60,7 +60,7 @@ struct DatabaseSelection {
|
|||||||
const SongFilter *_filter=nullptr) noexcept;
|
const SongFilter *_filter=nullptr) noexcept;
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept;
|
bool IsFiltered() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does this selection contain constraints other than "base"?
|
* Does this selection contain constraints other than "base"?
|
||||||
|
@ -992,7 +992,7 @@ ProxyDatabase::Visit(const DatabaseSelection &selection,
|
|||||||
visit_song);
|
visit_song);
|
||||||
|
|
||||||
if (!visit_directory && !visit_playlist && selection.recursive &&
|
if (!visit_directory && !visit_playlist && selection.recursive &&
|
||||||
!selection.IsEmpty()) {
|
selection.IsFiltered()) {
|
||||||
/* this optimized code path can only be used under
|
/* this optimized code path can only be used under
|
||||||
certain conditions */
|
certain conditions */
|
||||||
::SearchSongs(connection, selection, visit_song);
|
::SearchSongs(connection, selection, visit_song);
|
||||||
|
Loading…
Reference in New Issue
Block a user