mirror of https://github.com/qpdf/qpdf.git
Performance: remove Members indirection for Pipeline
This commit is contained in:
parent
cc755e37f7
commit
97de12343b
|
@ -78,26 +78,10 @@ class QPDF_DLL_CLASS Pipeline
|
||||||
std::string identifier;
|
std::string identifier;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Do not implement copy or assign
|
Pipeline(Pipeline const&) = delete;
|
||||||
Pipeline(Pipeline const&);
|
Pipeline& operator=(Pipeline const&) = delete;
|
||||||
Pipeline& operator=(Pipeline const&);
|
|
||||||
|
|
||||||
class Members
|
Pipeline* next;
|
||||||
{
|
|
||||||
friend class Pipeline;
|
|
||||||
|
|
||||||
public:
|
|
||||||
QPDF_DLL
|
|
||||||
~Members();
|
|
||||||
|
|
||||||
private:
|
|
||||||
Members(Pipeline* next);
|
|
||||||
Members(Members const&);
|
|
||||||
|
|
||||||
Pipeline* next;
|
|
||||||
};
|
|
||||||
|
|
||||||
PointerHolder<Members> m;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PIPELINE_HH
|
#endif // PIPELINE_HH
|
||||||
|
|
|
@ -1,18 +1,9 @@
|
||||||
#include <qpdf/Pipeline.hh>
|
#include <qpdf/Pipeline.hh>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
Pipeline::Members::Members(Pipeline* next) :
|
|
||||||
next(next)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Pipeline::Members::~Members()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Pipeline::Pipeline(char const* identifier, Pipeline* next) :
|
Pipeline::Pipeline(char const* identifier, Pipeline* next) :
|
||||||
identifier(identifier),
|
identifier(identifier),
|
||||||
m(new Members(next))
|
next(next)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,13 +14,13 @@ Pipeline::~Pipeline()
|
||||||
Pipeline*
|
Pipeline*
|
||||||
Pipeline::getNext(bool allow_null)
|
Pipeline::getNext(bool allow_null)
|
||||||
{
|
{
|
||||||
if ((this->m->next == 0) && (! allow_null))
|
if ((this->next == 0) && (! allow_null))
|
||||||
{
|
{
|
||||||
throw std::logic_error(
|
throw std::logic_error(
|
||||||
this->identifier +
|
this->identifier +
|
||||||
": Pipeline::getNext() called on pipeline with no next");
|
": Pipeline::getNext() called on pipeline with no next");
|
||||||
}
|
}
|
||||||
return this->m->next;
|
return this->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
|
|
Loading…
Reference in New Issue