diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-07-30 19:32:59 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-07-31 16:32:55 +0200 |
commit | 0e3d4cdc9753ae59d42ff8478b0769196899032b (patch) | |
tree | b6919e42f14ba4e63290d8b5658659e3e18cdb9a /libqpdf/JSON.cc | |
parent | 8ad39a6c9ab29f933d2f5fa2a0aee4e5e093b068 (diff) | |
download | qpdf-0e3d4cdc9753ae59d42ff8478b0769196899032b.tar.zst |
Fix/clarify meaning of depth parameter to json write methods
Diffstat (limited to 'libqpdf/JSON.cc')
-rw-r--r-- | libqpdf/JSON.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc index d380049f..c825413e 100644 --- a/libqpdf/JSON.cc +++ b/libqpdf/JSON.cc @@ -56,7 +56,7 @@ JSON::writeNext(Pipeline* p, bool& first, size_t depth) *p << ","; } *p << "\n"; - writeIndent(p, 1 + depth); + writeIndent(p, depth); } void @@ -102,7 +102,7 @@ JSON::writeDictionaryItem( size_t depth) { writeDictionaryKey(p, first, key, depth); - value.write(p, 1 + depth); + value.write(p, depth); } void @@ -110,7 +110,7 @@ JSON::writeArrayItem( Pipeline* p, bool& first, JSON const& element, size_t depth) { writeNext(p, first, depth); - element.write(p, 1 + depth); + element.write(p, depth); } void @@ -119,7 +119,7 @@ JSON::JSON_dictionary::write(Pipeline* p, size_t depth) const bool first = true; writeDictionaryOpen(p, first, depth); for (auto const& iter: members) { - writeDictionaryItem(p, first, iter.first, iter.second, depth); + writeDictionaryItem(p, first, iter.first, iter.second, 1 + depth); } writeDictionaryClose(p, first, depth); } @@ -130,7 +130,7 @@ JSON::JSON_array::write(Pipeline* p, size_t depth) const bool first = true; writeArrayOpen(p, first, depth); for (auto const& element: elements) { - writeArrayItem(p, first, element, depth); + writeArrayItem(p, first, element, 1 + depth); } writeArrayClose(p, first, depth); } |