From e42b1f6a102b526b746d47c9d60ec3cac39d07e2 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 29 Jun 2011 21:23:23 +1000 Subject: [PATCH] Pass object::insert string by const reference --- json.cpp.rl | 2 +- json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/json.cpp.rl b/json.cpp.rl index 9e85fd54..3435483f 100644 --- a/json.cpp.rl +++ b/json.cpp.rl @@ -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; } diff --git a/json.hpp b/json.hpp index 7fcdd64f..a2191a6e 100644 --- a/json.hpp +++ b/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;