Do not use const references for nlohmann json objects.

This commit is contained in:
Lukas Steiner
2021-06-16 09:28:18 +02:00
parent 9b135948e6
commit 123f7388b2
2 changed files with 4 additions and 4 deletions

View File

@@ -44,7 +44,7 @@
using json = nlohmann::json;
unsigned int AddressDecoder::getUnsignedAttrFromJson(const nlohmann::json &obj, const std::string &strName)
unsigned int AddressDecoder::getUnsignedAttrFromJson(json &obj, const std::string &strName)
{
if (!obj[strName].empty())
{
@@ -65,7 +65,7 @@ unsigned int AddressDecoder::getUnsignedAttrFromJson(const nlohmann::json &obj,
}
}
std::vector<unsigned> AddressDecoder::getAttrToVectorFromJson(const nlohmann::json &obj, const std::string &strName)
std::vector<unsigned> AddressDecoder::getAttrToVectorFromJson(json &obj, const std::string &strName)
{
std::vector<unsigned> vParameter;
if (!obj[strName].empty())

View File

@@ -75,8 +75,8 @@ public:
void print();
private:
static std::vector<unsigned> getAttrToVectorFromJson(const nlohmann::json &obj, const std::string &strName);
static unsigned int getUnsignedAttrFromJson(const nlohmann::json &obj, const std::string &strName);
static std::vector<unsigned> getAttrToVectorFromJson(nlohmann::json &obj, const std::string &strName);
static unsigned int getUnsignedAttrFromJson(nlohmann::json &obj, const std::string &strName);
unsigned banksPerGroup;
unsigned bankgroupsPerRank;