From c8bb600d2729d2588e9af9d6d4a95ff0f59f63dc Mon Sep 17 00:00:00 2001 From: Marian Klymov Date: Sat, 2 Jun 2018 19:41:57 +0300 Subject: [PATCH] Pass string as a const reference. --- include/json/writer.h | 2 +- src/lib_json/json_writer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/json/writer.h b/include/json/writer.h index 30424b0..7c9ae21 100644 --- a/include/json/writer.h +++ b/include/json/writer.h @@ -300,7 +300,7 @@ public: /** * \param indentation Each level will be indented by this amount extra. */ - StyledStreamWriter(JSONCPP_STRING indentation = "\t"); + StyledStreamWriter(const JSONCPP_STRING& indentation = "\t"); ~StyledStreamWriter() {} public: diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 95e7b1c..e0e47ad 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -643,7 +643,7 @@ bool StyledWriter::hasCommentForValue(const Value& value) { // Class StyledStreamWriter // ////////////////////////////////////////////////////////////////// -StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation) +StyledStreamWriter::StyledStreamWriter(const JSONCPP_STRING& indentation) : document_(NULL), rightMargin_(74), indentation_(indentation), addChildValues_(), indented_(false) {}