From dd116d79981d2b765ff394c5edc2ebd11d604e82 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sat, 24 Jul 2021 21:28:50 -0400 Subject: Fix check for the first key in JSON stringify from Dictionary code --- core/io/json.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/io/json.cpp b/core/io/json.cpp index 77a6181931..0381b78172 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -121,8 +121,11 @@ String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_ keys.sort(); } + bool first_key = true; for (Variant &E : keys) { - if (E != keys.front()) { + if (first_key) { + first_key = false; + } else { s += ","; s += end_statement; } -- cgit v1.2.3