fixed dtsod serilization bug

This commit is contained in:
timerix 2022-08-27 22:44:15 +06:00
parent 03b9ede382
commit 45c4f383ee

View File

@ -74,15 +74,14 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
}
else if(u.typeId==kerepTypeId_HashtablePtr){
// check hashtable is blank
bool hashtableNotBlank=false;
Hashtable_foreach(((Hashtable*)u.VoidPtr), __, ({
goto hashtableNotBlank;
hashtableNotBlank=true;
if(__.key); // weird way to disable warning
break;
}));
// blank hashtable
addc('{');
addc('}');
// not blank hashtable
hashtableNotBlank:
if(hashtableNotBlank){
addc('\n');
AppendTabs();
addc('{');
@ -91,6 +90,11 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
AppendTabs();
addc('}');
}
else {
addc('{');
addc('}');
}
}
else {
dbg((u.typeId));
safethrow(ERR_WRONGTYPE,;);