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){ 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('}');
// not blank hashtable
hashtableNotBlank:
addc('\n'); addc('\n');
AppendTabs(); AppendTabs();
addc('{'); addc('{');
@ -91,6 +90,11 @@ Maybe __AppendValue(SerializeSharedData* shared, Unitype u){
AppendTabs(); AppendTabs();
addc('}'); addc('}');
} }
else {
addc('{');
addc('}');
}
}
else { else {
dbg((u.typeId)); dbg((u.typeId));
safethrow(ERR_WRONGTYPE,;); safethrow(ERR_WRONGTYPE,;);