summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/json.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}