mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-22 22:58:33 +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);
|
||||
if (oh.isScalar())
|
||||
{
|
||||
QTC::TC("qpdf", "QPDF opt flatten array scalar");
|
||||
oh.makeDirect();
|
||||
node.setArrayItem(i, oh);
|
||||
if (oh.isIndirect())
|
||||
{
|
||||
QTC::TC("qpdf", "QPDF opt flatten array scalar");
|
||||
oh.makeDirect();
|
||||
node.setArrayItem(i, oh);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -136,9 +139,12 @@ QPDF::flattenScalarReferences()
|
||||
}
|
||||
else if (oh.isScalar())
|
||||
{
|
||||
QTC::TC("qpdf", "QPDF opt flatten dict scalar");
|
||||
oh.makeDirect();
|
||||
dict.replaceKey(key, oh);
|
||||
if (oh.isIndirect())
|
||||
{
|
||||
QTC::TC("qpdf", "QPDF opt flatten dict scalar");
|
||||
oh.makeDirect();
|
||||
dict.replaceKey(key, oh);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user