File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
110
110
* - Number of precision digits for formatting of real values.
111
111
* - "precisionType": "significant"(default) or "decimal"
112
112
* - Type of precision for formatting of real values.
113
+ * - "emitUTF8": false or true
114
+ * - If true, outputs raw UTF8 strings instead of escaping them.
113
115
114
116
* You can examine 'settings_` yourself
115
117
* to see the defaults. You can also write and read them just like any
Original file line number Diff line number Diff line change @@ -1398,13 +1398,11 @@ String Value::Comments::get(CommentPlacement slot) const {
1398
1398
}
1399
1399
1400
1400
void Value::Comments::set (CommentPlacement slot, String comment) {
1401
- if (!ptr_) {
1401
+ if (slot >= CommentPlacement::numberOfCommentPlacement)
1402
+ return ;
1403
+ if (!ptr_)
1402
1404
ptr_ = std::unique_ptr<Array>(new Array ());
1403
- }
1404
- // check comments array boundry.
1405
- if (slot < CommentPlacement::numberOfCommentPlacement) {
1406
- (*ptr_)[slot] = std::move (comment);
1407
- }
1405
+ (*ptr_)[slot] = std::move (comment);
1408
1406
}
1409
1407
1410
1408
void Value::setComment (String comment, CommentPlacement placement) {
You can’t perform that action at this time.
0 commit comments