JSON made serialization more compact and undid last commit

This commit is contained in:
2025-04-08 23:06:56 -05:00
parent 3298c335e6
commit e8ff8d5bc1

View File

@ -480,18 +480,16 @@ namespace Tesses::Framework::Serialization::Json
bool first=true;
for(auto item : dict)
{
if(!first) {
str.push_back(',');
}
if(indent) {
if(first) str.push_back(',');
str.append("\n");
str.append(tab(Encode(item.first,true) + ": " + Encode(item.second,true)));
}
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;
}
@ -506,18 +504,16 @@ namespace Tesses::Framework::Serialization::Json
for(auto item : ls)
{
if(!first) {
str.push_back(',');
}
if(indent) {
if(!first) {
str.push_back(',');
}
str.append("\n");
str.append(tab(Encode(item,true)));
}
else
{
if(!first) str.append(", ");
str.append(Encode(item,false));
str.append(Encode(item,false));
}
first=false;
}