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 {
return IsRegex()
? (negated ? "!~" : "=~")
: (substring
? (negated ? "!contains" : "contains")
: (starts_with
? (negated ? "!starts_with" : "starts_with")
: (negated ? "!=" : "==")));
if (IsRegex())
return negated ? "!~" : "=~";
if (substring)
return negated ? "!contains" : "contains";
if (starts_with)
return negated ? "!starts_with" : "starts_with";
return negated ? "!=" : "==";
}
[[gnu::pure]]