diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 02f1cb1..802f96c 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -582,7 +582,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) { while (iter != comment.end()) { document_ += *iter; if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) + ((iter+1) != comment.end() && *(iter + 1) == '/')) writeIndent(); ++iter; } @@ -798,7 +798,7 @@ void StyledStreamWriter::writeCommentBeforeValue(const Value& root) { while (iter != comment.end()) { *document_ << *iter; if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) + ((iter+1) != comment.end() && *(iter + 1) == '/')) // writeIndent(); // would include newline *document_ << indentString_; ++iter; @@ -1086,7 +1086,7 @@ void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) { while (iter != comment.end()) { *sout_ << *iter; if (*iter == '\n' && - (iter != comment.end() && *(iter + 1) == '/')) + ((iter+1) != comment.end() && *(iter + 1) == '/')) // writeIndent(); // would write extra newline *sout_ << indentString_; ++iter;