Update json_value.cpp

Remove redundant comments.
This commit is contained in:
Sun Yiming Z 2021-03-18 14:40:54 +08:00 committed by GitHub
parent 8780fb07c7
commit ea66d9825f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1398,11 +1398,10 @@ String Value::Comments::get(CommentPlacement slot) const {
} }
void Value::Comments::set(CommentPlacement slot, String comment) { void Value::Comments::set(CommentPlacement slot, String comment) {
if (slot >= CommentPlacement::numberOfCommentPlacement) {
return;
}
if (!ptr_) { if (!ptr_) {
ptr_ = std::unique_ptr<Array>(new Array()); ptr_ = std::unique_ptr<Array>(new Array());
}
if (slot < CommentPlacement::numberOfCommentPlacement) {
(*ptr_)[slot] = std::move(comment); (*ptr_)[slot] = std::move(comment);
} }
} }