aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/writer/json.cpp
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.ru>2022-02-10 16:46:31 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:31 +0300
commit317da38588b7898a99fd9168571408123350012b (patch)
tree25eebc31526019ad39a6c1b13f492963d97ba439 /library/cpp/json/writer/json.cpp
parent3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff)
downloadydb-317da38588b7898a99fd9168571408123350012b.tar.gz
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/writer/json.cpp')
-rw-r--r--library/cpp/json/writer/json.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/json/writer/json.cpp b/library/cpp/json/writer/json.cpp
index 02370c2d79..afc98b8a60 100644
--- a/library/cpp/json/writer/json.cpp
+++ b/library/cpp/json/writer/json.cpp
@@ -89,24 +89,24 @@ namespace NJsonWriter {
const int indentation = IndentSpaces * (Stack.size() - 1);
if (!indentation && !closing)
return;
-
- PrintWhitespaces(Max(0, indentation), true);
- }
-
- void TBuf::PrintWhitespaces(size_t count, bool prependWithNewLine) {
- static constexpr TStringBuf whitespacesTemplate = "\n ";
- static_assert(whitespacesTemplate[0] == '\n');
- static_assert(whitespacesTemplate[1] == ' ');
-
- count += (prependWithNewLine);
- do {
- const TStringBuf buffer = whitespacesTemplate.SubString(prependWithNewLine ? 0 : 1, count);
- count -= buffer.size();
- UnsafeWriteRawBytes(buffer);
- prependWithNewLine = false; // skip '\n' in subsequent writes
- } while (count > 0);
- }
-
+
+ PrintWhitespaces(Max(0, indentation), true);
+ }
+
+ void TBuf::PrintWhitespaces(size_t count, bool prependWithNewLine) {
+ static constexpr TStringBuf whitespacesTemplate = "\n ";
+ static_assert(whitespacesTemplate[0] == '\n');
+ static_assert(whitespacesTemplate[1] == ' ');
+
+ count += (prependWithNewLine);
+ do {
+ const TStringBuf buffer = whitespacesTemplate.SubString(prependWithNewLine ? 0 : 1, count);
+ count -= buffer.size();
+ UnsafeWriteRawBytes(buffer);
+ prependWithNewLine = false; // skip '\n' in subsequent writes
+ } while (count > 0);
+ }
+
inline void TBuf::WriteComma() {
if (NeedComma) {
RawWriteChar(',');