From fc2cbc841a911094eaddca0e67aeee494601d8a6 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Fri, 14 Aug 2015 00:14:00 +0300 Subject: [PATCH] Another fix for JsonWriter::writeString * RMG description check passed --- lib/JsonDetail.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/JsonDetail.cpp b/lib/JsonDetail.cpp index af41bce47..6b01614d2 100644 --- a/lib/JsonDetail.cpp +++ b/lib/JsonDetail.cpp @@ -61,20 +61,32 @@ void JsonWriter::writeEntry(JsonVector::const_iterator entry) void JsonWriter::writeString(const std::string &string) { static const std::string escaped = "\"\\\b\f\n\r\t"; - static const std::string escaped_code = "\"\\bfnrt"; + + static const std::array escaped_code = {'\"', '\\', 'b', 'f', 'n', 'r', 't'}; out <<'\"'; size_t pos=0, start=0; for (; pos