diff options
author | smurylev <smurylev@yandex-team.ru> | 2022-02-10 16:50:34 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:34 +0300 |
commit | 90e044f3970467c14a384a4d261a5d55f4b29a66 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/protobuf/json/string_transform.cpp | |
parent | 82e516236e5bba43ff4dcd0e4ddf8fb30b3624d5 (diff) | |
download | ydb-90e044f3970467c14a384a4d261a5d55f4b29a66.tar.gz |
Restoring authorship annotation for <smurylev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/protobuf/json/string_transform.cpp')
-rw-r--r-- | library/cpp/protobuf/json/string_transform.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/protobuf/json/string_transform.cpp b/library/cpp/protobuf/json/string_transform.cpp index bccbf28c1b..7c42daa677 100644 --- a/library/cpp/protobuf/json/string_transform.cpp +++ b/library/cpp/protobuf/json/string_transform.cpp @@ -31,10 +31,10 @@ namespace NProtobufJson { if (str.empty()) { return str; } - + TString result; result.reserve(str.size()); - + char prev = str[0]; bool doneOutput = true; for (const char* it = str.c_str() + 1; *it; ++it) { @@ -46,14 +46,14 @@ namespace NProtobufJson { } prev = *it; } - + if ((doneOutput && prev != '\\') || !doneOutput) { - result += prev; - } - + result += prev; + } + return result; - } - + } + void TBase64EncodeBytesTransform::TransformBytes(TString &str) const { str = Base64Encode(str); } @@ -61,4 +61,4 @@ namespace NProtobufJson { void TBase64DecodeBytesTransform::TransformBytes(TString &str) const { str = Base64Decode(str); } -} +} |