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