From 23d50a2f14db56be4cb4efcc413b8ef44713613f Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 9 Aug 2022 21:34:34 +0100 Subject: Remove QPDFObjectHandle::initialized --- include/qpdf/QPDFObjectHandle.hh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index af454e75..1128c3ed 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -1584,7 +1584,6 @@ class QPDFObjectHandle QPDF* qpdf, QPDFObjGen const& og, std::shared_ptr const& obj) : - initialized(true), qpdf(qpdf), og(og), obj(obj) @@ -1640,8 +1639,6 @@ class QPDFObjectHandle static void warn(QPDF*, QPDFExc const&); void checkOwnership(QPDFObjectHandle const&) const; - bool initialized; - // Moving members of QPDFObjectHandle into a smart pointer incurs // a substantial performance penalty since QPDFObjectHandle // objects are copied around so frequently. @@ -1888,13 +1885,13 @@ QPDFObjectHandle::getGeneration() const inline bool QPDFObjectHandle::isIndirect() const { - return initialized && (getObjectID() != 0); + return (obj != nullptr) && (getObjectID() != 0); } inline bool QPDFObjectHandle::isInitialized() const { - return initialized; + return obj != nullptr; } // Indirect object accessors @@ -1915,7 +1912,7 @@ QPDFObjectHandle::setParsedOffset(qpdf_offset_t offset) { // This is called during parsing on newly created direct objects, // so we can't call dereference() here. - if (initialized) { + if (isInitialized()) { this->obj->setParsedOffset(offset); } } -- cgit v1.2.3-54-g00ecf