Pass object::insert string by const reference

This commit is contained in:
Danny Robson 2011-06-29 21:23:23 +10:00
parent d592432113
commit e42b1f6a10
2 changed files with 2 additions and 2 deletions

View File

@ -331,7 +331,7 @@ json::object::operator ==(const json::object &rhs) const {
void
json::object::insert (const std::string _key, json::node* value)
json::object::insert (const std::string &_key, json::node* value)
{ m_values[_key] = value; }

View File

@ -88,7 +88,7 @@ namespace json {
virtual bool operator==(const node &rhs) const
{ return rhs == *this; }
virtual void insert (const std::string _key, node* value);
virtual void insert (const std::string &_key, node *value);
virtual const node& operator[](const std::string &key) const;
virtual std::ostream& print (std::ostream &os) const;