Skip to content

Commit 7452872

Browse files
pavel-pimenovcdunn2001
authored andcommitted
"\n" -> '\n'
1 parent c00a3b9 commit 7452872

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/lib_json/json_value.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ JSONCPP_STRING Value::toStyledString() const {
14911491

14921492
JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : "";
14931493
out += Json::writeString(builder, *this);
1494-
out += "\n";
1494+
out += '\n';
14951495

14961496
return out;
14971497
}

Diff for: src/lib_json/json_writer.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ JSONCPP_STRING FastWriter::write(const Value& root) {
366366
document_.clear();
367367
writeValue(root);
368368
if (!omitEndingLineFeed_)
369-
document_ += "\n";
369+
document_ += '\n';
370370
return document_;
371371
}
372372

@@ -438,7 +438,7 @@ JSONCPP_STRING StyledWriter::write(const Value& root) {
438438
writeCommentBeforeValue(root);
439439
writeValue(root);
440440
writeCommentAfterValueOnSameLine(root);
441-
document_ += "\n";
441+
document_ += '\n';
442442
return document_;
443443
}
444444

@@ -608,7 +608,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
608608
if (!root.hasComment(commentBefore))
609609
return;
610610

611-
document_ += "\n";
611+
document_ += '\n';
612612
writeIndent();
613613
const JSONCPP_STRING& comment = root.getComment(commentBefore);
614614
JSONCPP_STRING::const_iterator iter = comment.begin();
@@ -620,17 +620,17 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
620620
}
621621

622622
// Comments are stripped of trailing newlines, so add one here
623-
document_ += "\n";
623+
document_ += '\n';
624624
}
625625

626626
void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
627627
if (root.hasComment(commentAfterOnSameLine))
628628
document_ += " " + root.getComment(commentAfterOnSameLine);
629629

630630
if (root.hasComment(commentAfter)) {
631-
document_ += "\n";
631+
document_ += '\n';
632632
document_ += root.getComment(commentAfter);
633-
document_ += "\n";
633+
document_ += '\n';
634634
}
635635
}
636636

0 commit comments

Comments
 (0)