Skip to content

Commit c8bb600

Browse files
committed
Pass string as a const reference.
1 parent 85a263e commit c8bb600

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/json/writer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API
300300
/**
301301
* \param indentation Each level will be indented by this amount extra.
302302
*/
303-
StyledStreamWriter(JSONCPP_STRING indentation = "\t");
303+
StyledStreamWriter(const JSONCPP_STRING& indentation = "\t");
304304
~StyledStreamWriter() {}
305305

306306
public:

src/lib_json/json_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ bool StyledWriter::hasCommentForValue(const Value& value) {
643643
// Class StyledStreamWriter
644644
// //////////////////////////////////////////////////////////////////
645645

646-
StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
646+
StyledStreamWriter::StyledStreamWriter(const JSONCPP_STRING& indentation)
647647
: document_(NULL), rightMargin_(74), indentation_(indentation),
648648
addChildValues_(), indented_(false) {}
649649

0 commit comments

Comments
 (0)