mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Huge performance improvement: passing variables as pointers avoiding copies
This commit is contained in:
@@ -27,18 +27,16 @@
|
||||
namespace ModSecurity {
|
||||
namespace Variables {
|
||||
|
||||
std::list<std::pair<std::string, std::string>>
|
||||
std::list<ModSecurityStringVar *> *
|
||||
Duration::evaluate(Assay *assay) {
|
||||
std::list<std::pair<std::string, std::string>> resl;
|
||||
std::list<ModSecurityStringVar *> *resl = new std::list<ModSecurityStringVar *>();
|
||||
std::string res;
|
||||
std::pair<std::string, std::string> pair;
|
||||
|
||||
double e = cpu_seconds() - assay->start;
|
||||
|
||||
res = std::to_string(e);
|
||||
|
||||
pair = std::make_pair(std::string("DURATION"), std::string(res));
|
||||
resl.push_back(pair);
|
||||
resl->push_back(new ModSecurityStringVar("DURATION", std::string(res)));
|
||||
|
||||
return resl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user