MCPcopy Create free account
hub / github.com/catboost/catboost / PrintWhitespaces

Method PrintWhitespaces

library/cpp/json/ordered_maps/json_ordered.cpp:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 void TBuf::PrintWhitespaces(size_t count, bool prependWithNewLine) {
101 static constexpr TStringBuf whitespacesTemplate = "\n ";
102 static_assert(whitespacesTemplate[0] == '\n');
103 static_assert(whitespacesTemplate[1] == ' ');
104
105 count += (prependWithNewLine);
106 do {
107 const TStringBuf buffer = whitespacesTemplate.SubString(prependWithNewLine ? 0 : 1, count);
108 count -= buffer.size();
109 UnsafeWriteRawBytes(buffer);
110 prependWithNewLine = false; // skip '\n' in subsequent writes
111 } while (count > 0);
112 }
113
114 inline void TBuf::WriteComma() {
115 if (NeedComma) {

Callers

nothing calls this directly

Calls 2

SubStringMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected