From d59bd2ba66671091fdce4c7baa22898ff196cba7 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 27 Jan 2024 01:29:39 +0100 Subject: [PATCH] Indentation adjustments --- SurrealEngine/JsonValue.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SurrealEngine/JsonValue.cpp b/SurrealEngine/JsonValue.cpp index b81a5f10..c066c2bb 100644 --- a/SurrealEngine/JsonValue.cpp +++ b/SurrealEngine/JsonValue.cpp @@ -92,10 +92,11 @@ void JsonValueImpl::write_array(const JsonValue &value, std::string &json, int i void JsonValueImpl::write_object(const JsonValue &value, std::string &json, int indent) { + json += "{"; + if (indent >= 0) indent += 2; - json += "{"; std::map::const_iterator it; for (it = value.properties().begin(); it != value.properties().end(); ++it) { @@ -108,6 +109,10 @@ void JsonValueImpl::write_object(const JsonValue &value, std::string &json, int json.push_back(' '); write(it->second, json, indent); } + + if (indent >= 0) + indent -= 2; + write_indent(json, indent); json += "}"; }