Huge performance improvement: passing variables as pointers avoiding copies

This commit is contained in:
Felipe Zimmerle
2015-09-18 20:21:12 -03:00
parent 2451bf05d7
commit 076a02951c
45 changed files with 207 additions and 208 deletions

View File

@@ -33,14 +33,11 @@
namespace ModSecurity {
namespace Variables {
std::list<std::pair<std::string, std::string>>
std::list<ModSecurityStringVar *> *
TimeEpoch::evaluate(Assay *assay) {
std::list<std::pair<std::string, std::string>> resl;
std::pair<std::string, std::string> pair;
std::list<ModSecurityStringVar *> *resl = new std::list<ModSecurityStringVar *>();
pair = std::make_pair(std::string("TIME_EPOCH"),
std::to_string(std::time(nullptr)));
resl.push_back(pair);
resl->push_back(new ModSecurityStringVar("TIME_EPOCH", std::to_string(std::time(nullptr))));
return resl;
}