Update json_value.cpp

This commit is contained in:
Sun Yiming Z 2021-03-18 09:55:21 +08:00 committed by GitHub
parent 0707eefd55
commit 3345a5cf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1401,7 +1401,7 @@ void Value::Comments::set(CommentPlacement slot, String comment) {
if (!ptr_) {
ptr_ = std::unique_ptr<Array>(new Array());
}
// check comments array boundary.
if (slot < CommentPlacement::numberOfCommentPlacement) {
(*ptr_)[slot] = std::move(comment);
}