mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +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:
@@ -105,11 +105,11 @@ class Action {
|
||||
}
|
||||
|
||||
if (pos == std::string::npos) {
|
||||
m_name = std::shared_ptr<std::string>(new std::string(data));
|
||||
m_name = std::make_shared<std::string>(data);
|
||||
return;
|
||||
}
|
||||
|
||||
m_name = std::shared_ptr<std::string>(new std::string(data, 0, pos));
|
||||
m_name = std::make_shared<std::string>(data, 0, pos);
|
||||
m_parser_payload = std::string(data, pos + 1, data.length());
|
||||
|
||||
if (m_parser_payload.at(0) == '\'' && m_parser_payload.size() > 2) {
|
||||
|
Reference in New Issue
Block a user