aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2024-02-17 15:58:48 +0100
committerm-holger <m-holger@kubitscheck.org>2024-02-17 15:58:48 +0100
commit413aba5bf2ef239d3abf024de3c819e153171035 (patch)
treebc4f7ba1ce2cc2bc8412769f77aa80bd620c94aa
parent4f54508f7f3b9d9d97b1163156a89bfad582a5ea (diff)
downloadqpdf-413aba5bf2ef239d3abf024de3c819e153171035.tar.zst
Add comment to QPDF_Name::writeJSON
-rw-r--r--libqpdf/QPDF_Name.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libqpdf/QPDF_Name.cc b/libqpdf/QPDF_Name.cc
index bcc9498b..0e7f441a 100644
--- a/libqpdf/QPDF_Name.cc
+++ b/libqpdf/QPDF_Name.cc
@@ -60,7 +60,7 @@ QPDF_Name::analyzeJSONEncoding(const std::string& name)
std::basic_string_view<unsigned char> view{
reinterpret_cast<const unsigned char*>(name.data()), name.size()};
- int tail = 0; // Number of continuation characters expected.
+ int tail = 0; // Number of continuation characters expected.
bool tail2 = false; // Potential overlong 3 octet utf-8.
bool tail3 = false; // potential overlong 4 octet
bool needs_escaping = false;
@@ -106,6 +106,8 @@ QPDF_Name::analyzeJSONEncoding(const std::string& name)
void
QPDF_Name::writeJSON(int json_version, JSON::Writer& p)
{
+ // For performance reasons this code is duplicated in QPDF_Dictionary::writeJSON. When updating
+ // this method make sure QPDF_Dictionary is also update.
if (json_version == 1) {
p << "\"" << JSON::Writer::encode_string(normalizeName(name)) << "\"";
} else {