song/TagSongFilter: rename MatchNN() to Match()

The "NN" suffix used to mean "no negation", but that's not how it's
implemented today.
This commit is contained in:
Max Kellermann 2019-03-15 19:06:56 +01:00
parent 98b29f6d1c
commit 1881b0e975
2 changed files with 6 additions and 6 deletions

View File

@ -35,14 +35,14 @@ TagSongFilter::ToExpression() const noexcept
} }
bool bool
TagSongFilter::MatchNN(const TagItem &item) const noexcept TagSongFilter::Match(const TagItem &item) const noexcept
{ {
return (type == TAG_NUM_OF_ITEM_TYPES || item.type == type) && return (type == TAG_NUM_OF_ITEM_TYPES || item.type == type) &&
filter.Match(item.value); filter.Match(item.value);
} }
bool bool
TagSongFilter::MatchNN(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];
std::fill_n(visited_types, size_t(TAG_NUM_OF_ITEM_TYPES), false); std::fill_n(visited_types, size_t(TAG_NUM_OF_ITEM_TYPES), false);
@ -50,7 +50,7 @@ TagSongFilter::MatchNN(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 (MatchNN(i)) if (Match(i))
return true; return true;
} }
@ -89,5 +89,5 @@ TagSongFilter::MatchNN(const Tag &tag) const noexcept
bool bool
TagSongFilter::Match(const LightSong &song) const noexcept TagSongFilter::Match(const LightSong &song) const noexcept
{ {
return MatchNN(song.tag); return Match(song.tag);
} }

View File

@ -68,8 +68,8 @@ public:
bool Match(const LightSong &song) const noexcept override; bool Match(const LightSong &song) const noexcept override;
private: private:
bool MatchNN(const Tag &tag) const noexcept; bool Match(const Tag &tag) const noexcept;
bool MatchNN(const TagItem &tag) const noexcept; bool Match(const TagItem &tag) const noexcept;
}; };
#endif #endif