mirror of
https://github.com/qpdf/qpdf.git
synced 2025-02-02 11:58:25 +00:00
eliminate extraneous allocations by not calling makeDirect when we
know an object is already direct git-svn-id: svn+q:///qpdf/trunk@972 71b93d88-0707-0410-a8cf-f5a4172ac649
This commit is contained in:
parent
eef7154412
commit
bf75e208e9
@ -104,9 +104,12 @@ QPDF::flattenScalarReferences()
|
|||||||
QPDFObjectHandle oh = node.getArrayItem(i);
|
QPDFObjectHandle oh = node.getArrayItem(i);
|
||||||
if (oh.isScalar())
|
if (oh.isScalar())
|
||||||
{
|
{
|
||||||
QTC::TC("qpdf", "QPDF opt flatten array scalar");
|
if (oh.isIndirect())
|
||||||
oh.makeDirect();
|
{
|
||||||
node.setArrayItem(i, oh);
|
QTC::TC("qpdf", "QPDF opt flatten array scalar");
|
||||||
|
oh.makeDirect();
|
||||||
|
node.setArrayItem(i, oh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -136,9 +139,12 @@ QPDF::flattenScalarReferences()
|
|||||||
}
|
}
|
||||||
else if (oh.isScalar())
|
else if (oh.isScalar())
|
||||||
{
|
{
|
||||||
QTC::TC("qpdf", "QPDF opt flatten dict scalar");
|
if (oh.isIndirect())
|
||||||
oh.makeDirect();
|
{
|
||||||
dict.replaceKey(key, oh);
|
QTC::TC("qpdf", "QPDF opt flatten dict scalar");
|
||||||
|
oh.makeDirect();
|
||||||
|
dict.replaceKey(key, oh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user