Commit a8f82af6 authored by Jesse Beder's avatar Jesse Beder
Browse files

Switched Node::operator=(const Node&) to *not* force itself to create its node...

Switched Node::operator=(const Node&) to *not* force itself to create its node first (since we're just assigning them)
parent 0c321a6d
......@@ -138,9 +138,14 @@ namespace YAML
inline void Node::AssignNode(const Node& rhs)
{
EnsureNodeExists();
rhs.EnsureNodeExists();
if(!m_pNode) {
m_pNode = rhs.m_pNode;
m_pMemory = rhs.m_pMemory;
return;
}
m_pNode->set_ref(*rhs.m_pNode);
m_pMemory->merge(*rhs.m_pMemory);
m_pNode = rhs.m_pNode;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment