You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
Fix check for the first key in JSON stringify from Dictionary code
This commit is contained in:
@@ -121,8 +121,11 @@ String JSON::_stringify(const Variant &p_var, const String &p_indent, int p_cur_
|
|||||||
keys.sort();
|
keys.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool first_key = true;
|
||||||
for (Variant &E : keys) {
|
for (Variant &E : keys) {
|
||||||
if (E != keys.front()) {
|
if (first_key) {
|
||||||
|
first_key = false;
|
||||||
|
} else {
|
||||||
s += ",";
|
s += ",";
|
||||||
s += end_statement;
|
s += end_statement;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user