mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Removes copy form VariableValue
On `Use std::shared_ptr for variable resolution` @WGH changes VariableValue to be a shared_ptr. As shared pointer, the copy on AnchoredVariable is no longer necessary. The copy was removed along with the copy constructor.
This commit is contained in:
@@ -79,7 +79,7 @@ class AnchoredVariable {
|
||||
std::string m_value;
|
||||
|
||||
private:
|
||||
VariableValue m_var;
|
||||
std::shared_ptr<VariableValue> m_var;
|
||||
};
|
||||
|
||||
} // namespace modsecurity
|
||||
|
||||
@@ -60,20 +60,7 @@ class VariableValue {
|
||||
m_value(*value)
|
||||
{ }
|
||||
|
||||
VariableValue(const VariableValue &o) :
|
||||
m_collection(o.m_collection),
|
||||
m_key(o.m_key),
|
||||
m_keyWithCollection(o.m_keyWithCollection),
|
||||
m_value(o.m_value)
|
||||
{
|
||||
for (auto &i : o.m_orign) {
|
||||
VariableOrigin *origin(new VariableOrigin());
|
||||
origin->m_offset = i.m_offset;
|
||||
origin->m_length = i.m_length;
|
||||
m_orign.push_back(*origin);
|
||||
}
|
||||
}
|
||||
|
||||
VariableValue(const VariableValue &o) = delete;
|
||||
|
||||
const std::string& getName() const noexcept {
|
||||
return m_keyWithCollection;
|
||||
|
||||
Reference in New Issue
Block a user