aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDF_Array.hh
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2023-03-26 21:02:49 +0200
committerm-holger <m-holger@kubitscheck.org>2023-03-29 13:10:19 +0200
commit8fdc3f09648ad2c79455363255b9f8fdac9e65f3 (patch)
treeed76678105360f7de31e17efd27663831743399e /libqpdf/qpdf/QPDF_Array.hh
parent18c1ffe0df335a46cddbeb96e2cb939d850df9fa (diff)
downloadqpdf-8fdc3f09648ad2c79455363255b9f8fdac9e65f3.tar.zst
Optimize QPDFParser for non-sparse QPDF_Arrays
Stop using nullptr to represent null objects. Count null array elements and trigger creation of sparse arrays if null count is greater than 100.
Diffstat (limited to 'libqpdf/qpdf/QPDF_Array.hh')
-rw-r--r--libqpdf/qpdf/QPDF_Array.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/libqpdf/qpdf/QPDF_Array.hh b/libqpdf/qpdf/QPDF_Array.hh
index 1c4227ba..00c7f59d 100644
--- a/libqpdf/qpdf/QPDF_Array.hh
+++ b/libqpdf/qpdf/QPDF_Array.hh
@@ -15,7 +15,7 @@ class QPDF_Array: public QPDFValue
static std::shared_ptr<QPDFObject>
create(std::vector<QPDFObjectHandle> const& items);
static std::shared_ptr<QPDFObject>
- create(std::vector<std::shared_ptr<QPDFObject>>&& items);
+ create(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
static std::shared_ptr<QPDFObject> create(SparseOHArray const& items);
static std::shared_ptr<QPDFObject> create(OHArray const& items);
virtual std::shared_ptr<QPDFObject> copy(bool shallow = false);
@@ -36,7 +36,7 @@ class QPDF_Array: public QPDFValue
private:
QPDF_Array(std::vector<QPDFObjectHandle> const& items);
- QPDF_Array(std::vector<std::shared_ptr<QPDFObject>>&& items);
+ QPDF_Array(std::vector<std::shared_ptr<QPDFObject>>&& items, bool sparse);
QPDF_Array(SparseOHArray const& items);
QPDF_Array(OHArray const& items);
bool sparse{false};