From ab1adf72a232360770baa722f8b1af00782b4b7b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 30 Jan 2026 11:21:01 +0100 Subject: [PATCH 1/2] song/Filter, db/Selection: remove unused method HasOtherThanBase() The last caller was removed long ago by commit 9cc960ac5ee4b04562cd34001165f83f6c4fdb0c --- src/db/Selection.cxx | 6 ------ src/db/Selection.hxx | 6 ------ src/song/Filter.cxx | 10 ---------- src/song/Filter.hxx | 6 ------ 4 files changed, 28 deletions(-) diff --git a/src/db/Selection.cxx b/src/db/Selection.cxx index 966d8ee204..4df4d9ed8d 100644 --- a/src/db/Selection.cxx +++ b/src/db/Selection.cxx @@ -23,12 +23,6 @@ DatabaseSelection::IsFiltered() const noexcept return !uri.empty() || (filter != nullptr && !filter->IsEmpty()); } -bool -DatabaseSelection::HasOtherThanBase() const noexcept -{ - return filter != nullptr && filter->HasOtherThanBase(); -} - bool DatabaseSelection::Match(const LightSong &song) const noexcept { diff --git a/src/db/Selection.hxx b/src/db/Selection.hxx index a8c8a58c55..3841627bf2 100644 --- a/src/db/Selection.hxx +++ b/src/db/Selection.hxx @@ -46,12 +46,6 @@ struct DatabaseSelection { [[gnu::pure]] bool IsFiltered() const noexcept; - /** - * Does this selection contain constraints other than "base"? - */ - [[gnu::pure]] - bool HasOtherThanBase() const noexcept; - [[gnu::pure]] bool Match(const LightSong &song) const noexcept; }; diff --git a/src/song/Filter.cxx b/src/song/Filter.cxx index a809e4c43a..e77a1c6691 100644 --- a/src/song/Filter.cxx +++ b/src/song/Filter.cxx @@ -556,16 +556,6 @@ SongFilter::HasFoldCase() const noexcept }); } -bool -SongFilter::HasOtherThanBase() const noexcept -{ - return std::any_of(and_filter.GetItems().begin(), and_filter.GetItems().end(), - [=](const auto &item) { - return !dynamic_cast( - item.get()); - }); -} - const char * SongFilter::GetBase() const noexcept { diff --git a/src/song/Filter.hxx b/src/song/Filter.hxx index 3b31608757..8139bd3e02 100644 --- a/src/song/Filter.hxx +++ b/src/song/Filter.hxx @@ -79,12 +79,6 @@ public: [[gnu::pure]] bool HasFoldCase() const noexcept; - /** - * Does this filter contain constraints other than "base"? - */ - [[gnu::pure]] - bool HasOtherThanBase() const noexcept; - /** * Returns the "base" specification (if there is one) or * nullptr. From bc0024fc22e89c8ceb212a58eeb590581995d913 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 30 Jan 2026 11:22:33 +0100 Subject: [PATCH 2/2] song/Filter: add missing include for std::any_of() --- src/song/Filter.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/song/Filter.cxx b/src/song/Filter.cxx index e77a1c6691..fe05592927 100644 --- a/src/song/Filter.cxx +++ b/src/song/Filter.cxx @@ -22,6 +22,7 @@ #include "util/ASCII.hxx" #include "util/UriUtil.hxx" +#include // for std::any_of() #include #include