From 745287275c83538e495bcdbd9dfee4befa097b5e Mon Sep 17 00:00:00 2001 From: "pavel.pimenov" Date: Mon, 4 Jun 2018 09:06:24 +0300 Subject: [PATCH] "\n" -> '\n' --- src/lib_json/json_value.cpp | 2 +- src/lib_json/json_writer.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index cc5e8fe..01e9548 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -1491,7 +1491,7 @@ JSONCPP_STRING Value::toStyledString() const { JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : ""; out += Json::writeString(builder, *this); - out += "\n"; + out += '\n'; return out; } diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 5eaa041..47f413d 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -366,7 +366,7 @@ JSONCPP_STRING FastWriter::write(const Value& root) { document_.clear(); writeValue(root); if (!omitEndingLineFeed_) - document_ += "\n"; + document_ += '\n'; return document_; } @@ -438,7 +438,7 @@ JSONCPP_STRING StyledWriter::write(const Value& root) { writeCommentBeforeValue(root); writeValue(root); writeCommentAfterValueOnSameLine(root); - document_ += "\n"; + document_ += '\n'; return document_; } @@ -608,7 +608,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) { if (!root.hasComment(commentBefore)) return; - document_ += "\n"; + document_ += '\n'; writeIndent(); const JSONCPP_STRING& comment = root.getComment(commentBefore); JSONCPP_STRING::const_iterator iter = comment.begin(); @@ -620,7 +620,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) { } // Comments are stripped of trailing newlines, so add one here - document_ += "\n"; + document_ += '\n'; } void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { @@ -628,9 +628,9 @@ void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { document_ += " " + root.getComment(commentAfterOnSameLine); if (root.hasComment(commentAfter)) { - document_ += "\n"; + document_ += '\n'; document_ += root.getComment(commentAfter); - document_ += "\n"; + document_ += '\n'; } }