mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 02:48:31 +00:00
Tweak QPDF::read_xref
This commit is contained in:
parent
07f6c635a9
commit
5641832e54
@ -708,16 +708,11 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
|
||||
m->deleted_objects.clear();
|
||||
|
||||
// Make sure we keep only the highest generation for any object.
|
||||
QPDFObjGen::set to_delete;
|
||||
QPDFObjGen last_og;
|
||||
for (auto const& og: m->xref_table) {
|
||||
if (og.first.getObj() == last_og.getObj()) {
|
||||
to_delete.emplace(last_og);
|
||||
}
|
||||
last_og = og.first;
|
||||
}
|
||||
for (auto const& og: to_delete) {
|
||||
removeObject(og);
|
||||
QPDFObjGen last_og{-1, 0};
|
||||
for (auto const& [og, _xref]: m->xref_table) {
|
||||
if (og.getObj() == last_og.getObj())
|
||||
removeObject(last_og);
|
||||
last_og = og;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user