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
commit 6b11d8cc73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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