From 97de12343b908d937f4bb0562cd739896ce66d34 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 3 Apr 2020 11:59:29 -0400 Subject: [PATCH] Performance: remove Members indirection for Pipeline --- include/qpdf/Pipeline.hh | 22 +++------------------- libqpdf/Pipeline.cc | 15 +++------------ 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/include/qpdf/Pipeline.hh b/include/qpdf/Pipeline.hh index 325aa680..6cb6e969 100644 --- a/include/qpdf/Pipeline.hh +++ b/include/qpdf/Pipeline.hh @@ -78,26 +78,10 @@ class QPDF_DLL_CLASS Pipeline std::string identifier; private: - // Do not implement copy or assign - Pipeline(Pipeline const&); - Pipeline& operator=(Pipeline const&); + Pipeline(Pipeline const&) = delete; + Pipeline& operator=(Pipeline const&) = delete; - class Members - { - friend class Pipeline; - - public: - QPDF_DLL - ~Members(); - - private: - Members(Pipeline* next); - Members(Members const&); - - Pipeline* next; - }; - - PointerHolder m; + Pipeline* next; }; #endif // PIPELINE_HH diff --git a/libqpdf/Pipeline.cc b/libqpdf/Pipeline.cc index bd4fb087..7939eb6d 100644 --- a/libqpdf/Pipeline.cc +++ b/libqpdf/Pipeline.cc @@ -1,18 +1,9 @@ #include #include -Pipeline::Members::Members(Pipeline* next) : - next(next) -{ -} - -Pipeline::Members::~Members() -{ -} - Pipeline::Pipeline(char const* identifier, Pipeline* next) : identifier(identifier), - m(new Members(next)) + next(next) { } @@ -23,13 +14,13 @@ Pipeline::~Pipeline() Pipeline* Pipeline::getNext(bool allow_null) { - if ((this->m->next == 0) && (! allow_null)) + if ((this->next == 0) && (! allow_null)) { throw std::logic_error( this->identifier + ": Pipeline::getNext() called on pipeline with no next"); } - return this->m->next; + return this->next; } std::string