1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

Merge pull request #50828 from aaronfranke/fix-json-stringify-dict

Fix check for the first key in JSON stringify from Dictionary code
This commit is contained in:
Rémi Verschelde
2021-07-25 10:49:31 +02:00
committed by GitHub

View File

@@ -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;
}