Pass object::insert string by const reference
This commit is contained in:
parent
d592432113
commit
e42b1f6a10
@ -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; }
|
||||
|
||||
|
||||
|
2
json.hpp
2
json.hpp
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user