iterate over pair of const string and Json
parent
be631169db
commit
7fd738ae42
|
@ -100,7 +100,7 @@ static void dump(const string &value, string &out) {
|
||||||
static void dump(const Json::array &values, string &out) {
|
static void dump(const Json::array &values, string &out) {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
out += "[";
|
out += "[";
|
||||||
for (auto &value : values) {
|
for (const auto &value : values) {
|
||||||
if (!first)
|
if (!first)
|
||||||
out += ", ";
|
out += ", ";
|
||||||
value.dump(out);
|
value.dump(out);
|
||||||
|
@ -112,7 +112,7 @@ static void dump(const Json::array &values, string &out) {
|
||||||
static void dump(const Json::object &values, string &out) {
|
static void dump(const Json::object &values, string &out) {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
out += "{";
|
out += "{";
|
||||||
for (const std::pair<string, Json> &kv : values) {
|
for (const auto &kv : values) {
|
||||||
if (!first)
|
if (!first)
|
||||||
out += ", ";
|
out += ", ";
|
||||||
dump(kv.first, out);
|
dump(kv.first, out);
|
||||||
|
|
Loading…
Reference in New Issue