JSON made serialization more compact and undid last commit
This commit is contained in:
@ -480,17 +480,15 @@ namespace Tesses::Framework::Serialization::Json
|
|||||||
bool first=true;
|
bool first=true;
|
||||||
for(auto item : dict)
|
for(auto item : dict)
|
||||||
{
|
{
|
||||||
|
if(!first) {
|
||||||
|
str.push_back(',');
|
||||||
|
}
|
||||||
if(indent) {
|
if(indent) {
|
||||||
if(first) str.push_back(',');
|
|
||||||
str.append("\n");
|
str.append("\n");
|
||||||
str.append(tab(Encode(item.first,true) + ": " + Encode(item.second,true)));
|
str.append(tab(Encode(item.first,true) + ": " + Encode(item.second,true)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!first) {
|
|
||||||
str.append(", ");
|
|
||||||
}
|
|
||||||
str.append(Encode(item.first,false)+":"+Encode(item.second,false));
|
str.append(Encode(item.first,false)+":"+Encode(item.second,false));
|
||||||
}
|
}
|
||||||
first=false;
|
first=false;
|
||||||
@ -506,17 +504,15 @@ namespace Tesses::Framework::Serialization::Json
|
|||||||
for(auto item : ls)
|
for(auto item : ls)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(indent) {
|
|
||||||
|
|
||||||
if(!first) {
|
if(!first) {
|
||||||
str.push_back(',');
|
str.push_back(',');
|
||||||
}
|
}
|
||||||
|
if(indent) {
|
||||||
str.append("\n");
|
str.append("\n");
|
||||||
str.append(tab(Encode(item,true)));
|
str.append(tab(Encode(item,true)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!first) str.append(", ");
|
|
||||||
str.append(Encode(item,false));
|
str.append(Encode(item,false));
|
||||||
}
|
}
|
||||||
first=false;
|
first=false;
|
||||||
|
|||||||
Reference in New Issue
Block a user