Minor changes for static analysis (#749)

re: #747
This commit is contained in:
Christopher Dunn 2018-03-03 12:51:17 -06:00 committed by GitHub
parent 1ab310e3ed
commit 3e2b8ea9cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -931,7 +931,7 @@ void Value::resize(ArrayIndex newSize) {
if (newSize == 0)
clear();
else if (newSize > oldSize)
(*this)[newSize - 1];
this->operator[](newSize - 1);
else {
for (ArrayIndex index = newSize; index < oldSize; ++index) {
value_.map_->erase(index);

View File

@ -623,7 +623,8 @@ bool StyledWriter::hasCommentForValue(const Value& value) {
StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
: document_(NULL), rightMargin_(74), indentation_(indentation),
addChildValues_() {}
addChildValues_(), indented_(false)
{}
void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
document_ = &out;