workspaces: refactor class member vars (#10167)

This commit is contained in:
davc0n 2025-04-25 02:37:12 +02:00 committed by GitHub
parent 0e80ecc534
commit 02d7badd15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 687 additions and 688 deletions

View file

@ -6,17 +6,17 @@
CRuleRegexContainer::CRuleRegexContainer(const std::string& regex_) {
const bool NEGATIVE = regex_.starts_with("negative:");
negative = NEGATIVE;
regex = makeUnique<RE2>(NEGATIVE ? regex_.substr(9) : regex_);
m_negative = NEGATIVE;
m_regex = makeUnique<RE2>(NEGATIVE ? regex_.substr(9) : regex_);
// TODO: maybe pop an error?
if (!regex->ok())
if (!m_regex->ok())
Debug::log(ERR, "RuleRegexContainer: regex {} failed to parse!", regex_);
}
bool CRuleRegexContainer::passes(const std::string& str) const {
if (!regex)
if (!m_regex)
return false;
return RE2::FullMatch(str, *regex) != negative;
return RE2::FullMatch(str, *m_regex) != m_negative;
}