diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/helpers/TagKeeper.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/helpers/TagKeeper.cpp b/src/helpers/TagKeeper.cpp index f960accb..3c7071d5 100644 --- a/src/helpers/TagKeeper.cpp +++ b/src/helpers/TagKeeper.cpp @@ -1,7 +1,10 @@ #include "TagKeeper.hpp" bool CTagKeeper::isTagged(const std::string& tag, bool strict) { - return m_tags.contains(tag) || (!strict && m_tags.contains(tag + "*")); + const bool NEGATIVE = tag.starts_with("negative"); + const auto MATCH = NEGATIVE ? tag.substr(9) : tag; + const bool TAGGED = m_tags.contains(MATCH) || (!strict && m_tags.contains(MATCH + "*")); + return NEGATIVE ? !TAGGED : TAGGED; } bool CTagKeeper::applyTag(const std::string& tag, bool dynamic) { |
