serialization: do not write optional fields with default value

This commit is contained in:
moneromooo-monero 2019-12-04 21:19:04 +00:00
parent 5f98b46d58
commit b595583f3d
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 4 additions and 2 deletions

View file

@ -89,6 +89,8 @@ public: \
#define KV_SERIALIZE_OPT_N(variable, val_name, default_value) \
do { \
if (is_store && this_ref.variable == default_value) \
break; \
if (!epee::serialization::selector<is_store>::serialize(this_ref.variable, stg, hparent_section, val_name)) \
epee::serialize_default(this_ref.variable, default_value); \
} while (0);