Commit 9e941829 authored by Max Kellermann's avatar Max Kellermann

song/TagSongFilter: eliminate Match(TagItem)

parent b850eb74
...@@ -35,13 +35,6 @@ TagSongFilter::ToExpression() const noexcept ...@@ -35,13 +35,6 @@ TagSongFilter::ToExpression() const noexcept
} }
bool 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 TagSongFilter::Match(const Tag &tag) const noexcept
{ {
bool visited_types[TAG_NUM_OF_ITEM_TYPES]{}; bool visited_types[TAG_NUM_OF_ITEM_TYPES]{};
...@@ -49,7 +42,8 @@ TagSongFilter::Match(const Tag &tag) const noexcept ...@@ -49,7 +42,8 @@ TagSongFilter::Match(const Tag &tag) const noexcept
for (const auto &i : tag) { for (const auto &i : tag) {
visited_types[i.type] = true; visited_types[i.type] = true;
if (Match(i)) if ((type == TAG_NUM_OF_ITEM_TYPES || i.type == type) &&
filter.Match(i.value))
return true; return true;
} }
......
...@@ -69,7 +69,6 @@ public: ...@@ -69,7 +69,6 @@ public:
private: private:
bool Match(const Tag &tag) const noexcept; bool Match(const Tag &tag) const noexcept;
bool Match(const TagItem &tag) const noexcept;
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment