From f48833343a6cb60eced241d250d4cdf62a61bee4 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 27 Aug 2013 20:30:38 +0200 Subject: [PATCH] Removed accidental C++11 dependancy. --- lib/json.cpp | 10 +++++----- lib/json.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/json.cpp b/lib/json.cpp index c9d0545f..68113298 100644 --- a/lib/json.cpp +++ b/lib/json.cpp @@ -439,19 +439,19 @@ JSON::Value & JSON::Value::operator[](unsigned int i){ /// Retrieves the JSON::Value at this position in the object. /// Fails horribly if that values does not exist. -JSON::Value const & JSON::Value::operator[](const std::string i) const{ - return objVal.at(i); +const JSON::Value & JSON::Value::operator[](const std::string i) const{ + return objVal.find(i)->second; } /// Retrieves the JSON::Value at this position in the object. /// Fails horribly if that values does not exist. -JSON::Value const & JSON::Value::operator[](const char * i) const{ - return objVal.at(i); +const JSON::Value & JSON::Value::operator[](const char * i) const{ + return objVal.find(i)->second; } /// Retrieves the JSON::Value at this position in the array. /// Fails horribly if that values does not exist. -JSON::Value const & JSON::Value::operator[](unsigned int i) const{ +const JSON::Value & JSON::Value::operator[](unsigned int i) const{ return arrVal[i]; } diff --git a/lib/json.h b/lib/json.h index 8dbea25f..63217205 100644 --- a/lib/json.h +++ b/lib/json.h @@ -72,9 +72,9 @@ namespace JSON { Value & operator[](const std::string i); Value & operator[](const char * i); Value & operator[](unsigned int i); - Value const & operator[](const std::string i) const; - Value const & operator[](const char * i) const; - Value const & operator[](unsigned int i) const; + const Value & operator[](const std::string i) const; + const Value & operator[](const char * i) const; + const Value & operator[](unsigned int i) const; //handy functions and others std::string toPacked(); void netPrepare();