2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 15:17:29 +00:00

Refactor JSON::writeClose

This commit is contained in:
m-holger 2023-01-28 11:09:46 +00:00 committed by Jay Berkenbilt
parent cb4debe75f
commit dfa7d414f5

View File

@ -32,11 +32,13 @@ JSON::JSON(std::shared_ptr<JSON_value> value) :
void
JSON::writeClose(Pipeline* p, bool first, size_t depth, char const* delimiter)
{
if (!first) {
*p << "\n";
writeIndent(p, depth);
if (first) {
*p << delimiter;
} else {
std::string s{"\n"};
s.append(2 * depth, ' ');
*p << s + delimiter;
}
*p << delimiter;
}
void