From 80556449a17c40ef096ced29280af835f5d073be Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 27 Nov 2015 16:45:26 -0500 Subject: [PATCH] Improve Json::get() slightly --- depends/jsoncpp/jsoncpp-ex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/jsoncpp/jsoncpp-ex.h b/depends/jsoncpp/jsoncpp-ex.h index 1a5286dd0..7d621dd72 100644 --- a/depends/jsoncpp/jsoncpp-ex.h +++ b/depends/jsoncpp/jsoncpp-ex.h @@ -11,7 +11,7 @@ namespace Json { template<> inline bool is (const Json::Value &val) { return val.is_func(); } \ template<> inline type as (const Json::Value &val) { return val.as_func(); } \ template<> inline type get (const Json::Value &val, const std::string &key, const type &default_) \ - { Json::Value x = val[key]; return is(x) ? as(x) : default_; } + { const Json::Value &x = val[key]; return is(x) ? as(x) : default_; } define_helpers(bool, isBool, asBool); define_helpers(Json::Int, isInt, asInt); define_helpers(Json::UInt, isUInt, asUInt);