diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-08-14 20:51:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-14 20:51:42 +0200 |
commit | 66da2ca3200d0f83e6504102c04e371581de9679 (patch) | |
tree | 55ad1a3621ef59676d336a9a73aae0f5b1f0ca45 | |
parent | e6a64b1888dd170feb3a555b7b432c0635899707 (diff) | |
parent | 929b416fdbf542e30cf13d0e7ef9610ff4f188fa (diff) |
Merge pull request #20856 from KoBeWi/pretty-dictionary-print
Add some curly braces to make dictionary printing less ambiguous
-rw-r--r-- | core/variant.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index 9fa51ec7c9..b0e97900a2 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1460,7 +1460,7 @@ Variant::operator String() const { const Dictionary &d = *reinterpret_cast<const Dictionary *>(_data._mem); //const String *K=NULL; - String str; + String str("{"); List<Variant> keys; d.get_key_list(&keys); @@ -1479,8 +1479,9 @@ Variant::operator String() const { for (int i = 0; i < pairs.size(); i++) { if (i > 0) str += ", "; - str += "(" + pairs[i].key + ":" + pairs[i].value + ")"; + str += pairs[i].key + ":" + pairs[i].value; } + str += "}"; return str; } break; |