mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Huge performance improvement: passing variables as pointers avoiding copies
This commit is contained in:
@@ -30,7 +30,7 @@ bool Rx::evaluate(Assay *assay, const std::string& input) {
|
||||
SMatch match;
|
||||
|
||||
if (regex_search(input, &match, *m_re) && match.size() >= 1) {
|
||||
this->matched.push_back(match.match);
|
||||
//this->matched.push_back(match.match);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -37,8 +37,7 @@ class Rx : public Operator {
|
||||
Rx(std::string op, std::string param, bool negation)
|
||||
: Operator(op, param, negation),
|
||||
m_param(param) {
|
||||
Regex r(param);
|
||||
m_re = &r;
|
||||
m_re = new Regex(param);
|
||||
}
|
||||
|
||||
bool evaluate(Assay *assay, const std::string &input);
|
||||
|
Reference in New Issue
Block a user