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 | 82e516236e5bba43ff4dcd0e4ddf8fb30b3624d5 (patch) | |
tree | e6a11d2715ea09a3c45cf6b4bd80c1b908cc9dd1 /library/cpp/protobuf/json/string_transform.cpp | |
parent | bfa8c3e83c12beb065db3c294bcad58628069502 (diff) | |
download | ydb-82e516236e5bba43ff4dcd0e4ddf8fb30b3624d5.tar.gz |
Restoring authorship annotation for <smurylev@yandex-team.ru>. Commit 1 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 7c42daa677..bccbf28c1b 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); } -} +} |