diff options
author | Max Kellermann <max@musicpd.org> | 2019-03-15 20:28:27 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-03-15 20:28:27 +0100 |
commit | 9e9418294a69bfcb27b8cc631ad32b1e6507f3c6 (patch) | |
tree | 54504a9372340727ef5739ebffab52cce1c1d89d /src | |
parent | b850eb74b761797da2b7028be4dbcd085f0e234a (diff) |
song/TagSongFilter: eliminate Match(TagItem)
Diffstat (limited to 'src')
-rw-r--r-- | src/song/TagSongFilter.cxx | 10 | ||||
-rw-r--r-- | src/song/TagSongFilter.hxx | 1 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/song/TagSongFilter.cxx b/src/song/TagSongFilter.cxx index 4b587c920..df92ed435 100644 --- a/src/song/TagSongFilter.cxx +++ b/src/song/TagSongFilter.cxx @@ -35,13 +35,6 @@ TagSongFilter::ToExpression() const noexcept } bool -TagSongFilter::Match(const TagItem &item) const noexcept -{ - return (type == TAG_NUM_OF_ITEM_TYPES || item.type == type) && - filter.Match(item.value); -} - -bool TagSongFilter::Match(const Tag &tag) const noexcept { bool visited_types[TAG_NUM_OF_ITEM_TYPES]{}; @@ -49,7 +42,8 @@ TagSongFilter::Match(const Tag &tag) const noexcept for (const auto &i : tag) { visited_types[i.type] = true; - if (Match(i)) + if ((type == TAG_NUM_OF_ITEM_TYPES || i.type == type) && + filter.Match(i.value)) return true; } diff --git a/src/song/TagSongFilter.hxx b/src/song/TagSongFilter.hxx index 6d0449d61..3f9f7051b 100644 --- a/src/song/TagSongFilter.hxx +++ b/src/song/TagSongFilter.hxx @@ -69,7 +69,6 @@ public: private: bool Match(const Tag &tag) const noexcept; - bool Match(const TagItem &tag) const noexcept; }; #endif |