mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-17 18:05:28 +03:00
leverage std::make_unique & std::make_shared
- Simpler code & more efficient because control block can be allocated with object.
This commit is contained in:
@@ -140,7 +140,7 @@ bool Operator::evaluate(Transaction *transaction, const std::string& a) {
|
||||
|
||||
Operator *Operator::instantiate(const std::string& op, const std::string& param_str) {
|
||||
std::string op_ = utils::string::tolower(op);
|
||||
std::unique_ptr<RunTimeString> param(new RunTimeString());
|
||||
auto param = std::make_unique<RunTimeString>();
|
||||
param->appendText(param_str);
|
||||
|
||||
IF_MATCH(beginswith) { return new BeginsWith(std::move(param)); }
|
||||
|
||||
Reference in New Issue
Block a user