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,22 +74,26 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
} }
else if(u.typeId==kerepTypeId_HashtablePtr){ else if(u.typeId==kerepTypeId_HashtablePtr){
// check hashtable is blank // check hashtable is blank
bool hashtableNotBlank=false;
Hashtable_foreach(((Hashtable*)u.VoidPtr), __, ({ Hashtable_foreach(((Hashtable*)u.VoidPtr), __, ({
goto hashtableNotBlank; hashtableNotBlank=true;
if(__.key); // weird way to disable warning if(__.key); // weird way to disable warning
break;
})); }));
// blank hashtable
addc('{'); if(hashtableNotBlank){
addc('}'); addc('\n');
// not blank hashtable AppendTabs();
hashtableNotBlank: addc('{');
addc('\n'); addc('\n');
AppendTabs(); try(__serialize(b,tabs+1,u.VoidPtr),___,;);
addc('{'); AppendTabs();
addc('\n'); addc('}');
try(__serialize(b,tabs+1,u.VoidPtr),___,;); }
AppendTabs(); else {
addc('}'); addc('{');
addc('}');
}
} }
else { else {
dbg((u.typeId)); dbg((u.typeId));