diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-18 08:42:58 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-18 08:42:58 +1000 |
commit | 1587bb240925dc7e3d549fd6d0fed101d6036ce7 (patch) | |
tree | 8eb9ddf2674c80a3fccc6e37943e630e3652ea2c /source/core/StarJsonParser.hpp | |
parent | 83ca73b299d6d6df810eeb0ebff803f67d7be3ac (diff) |
Empty JSON objects should be printed as {}, not { \n} + fix the new Json hasher not sorting keys
[skip ci]
Diffstat (limited to 'source/core/StarJsonParser.hpp')
-rw-r--r-- | source/core/StarJsonParser.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/core/StarJsonParser.hpp b/source/core/StarJsonParser.hpp index 91d93bb..c7a9cc6 100644 --- a/source/core/StarJsonParser.hpp +++ b/source/core/StarJsonParser.hpp @@ -521,11 +521,12 @@ public: } void endObject() { + if (currentState() == ObjectElement) { + if (m_pretty) + write('\n'); + indent(); + } popState(Object); - - if (m_pretty) - write('\n'); - indent(); write('}'); } |