Make up some of the performance losses #132

This commit is contained in:
Jason Turner
2014-08-30 14:49:31 -06:00
parent a71903f185
commit 4ee9ba9c96
2 changed files with 37 additions and 38 deletions

View File

@@ -249,12 +249,13 @@ namespace chaiscript
return (*m_data->m_attrs)[t_name];
}
void copy_attrs(const Boxed_Value &t_obj)
Boxed_Value &copy_attrs(const Boxed_Value &t_obj)
{
if (t_obj.m_data->m_attrs)
{
m_data->m_attrs = std::unique_ptr<std::map<std::string, Boxed_Value>>(new std::map<std::string, Boxed_Value>(*t_obj.m_data->m_attrs));
}
return *this;
}