Skip to content

Commit d0a1353

Browse files
authored
Merge branch 'master' into cmake-config-improvements
2 parents b6840db + 94cda30 commit d0a1353

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/json/writer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
110110
* - Number of precision digits for formatting of real values.
111111
* - "precisionType": "significant"(default) or "decimal"
112112
* - Type of precision for formatting of real values.
113+
* - "emitUTF8": false or true
114+
* - If true, outputs raw UTF8 strings instead of escaping them.
113115
114116
* You can examine 'settings_` yourself
115117
* to see the defaults. You can also write and read them just like any

src/lib_json/json_value.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,13 +1398,11 @@ String Value::Comments::get(CommentPlacement slot) const {
13981398
}
13991399

14001400
void Value::Comments::set(CommentPlacement slot, String comment) {
1401-
if (!ptr_) {
1401+
if (slot >= CommentPlacement::numberOfCommentPlacement)
1402+
return;
1403+
if (!ptr_)
14021404
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);
14081406
}
14091407

14101408
void Value::setComment(String comment, CommentPlacement placement) {

0 commit comments

Comments
 (0)