song/StringFilter: simplify GetOperator()

This commit is contained in:
Max Kellermann 2022-11-15 21:26:57 +01:00
parent c158abe87c
commit 9ca75589c0

View File

@ -99,13 +99,16 @@ public:
} }
const char *GetOperator() const noexcept { const char *GetOperator() const noexcept {
return IsRegex() if (IsRegex())
? (negated ? "!~" : "=~") return negated ? "!~" : "=~";
: (substring
? (negated ? "!contains" : "contains") if (substring)
: (starts_with return negated ? "!contains" : "contains";
? (negated ? "!starts_with" : "starts_with")
: (negated ? "!=" : "=="))); if (starts_with)
return negated ? "!starts_with" : "starts_with";
return negated ? "!=" : "==";
} }
[[gnu::pure]] [[gnu::pure]]