Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarJsonParser.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-04-18 08:42:58 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-04-18 08:42:58 +1000
commit1587bb240925dc7e3d549fd6d0fed101d6036ce7 (patch)
tree8eb9ddf2674c80a3fccc6e37943e630e3652ea2c /source/core/StarJsonParser.hpp
parent83ca73b299d6d6df810eeb0ebff803f67d7be3ac (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.hpp9
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('}');
}