2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-10 23:20:58 +00:00

Change QPDFWriter::object_queue to std::vector

This commit is contained in:
m-holger 2023-01-08 12:52:33 +00:00 committed by Jay Berkenbilt
parent 9c216a06d9
commit 8363657cf3
2 changed files with 5 additions and 4 deletions

View File

@ -751,7 +751,8 @@ class QPDFWriter
std::string cur_data_key; std::string cur_data_key;
std::list<std::shared_ptr<Pipeline>> to_delete; std::list<std::shared_ptr<Pipeline>> to_delete;
Pl_Count* pipeline; Pl_Count* pipeline;
std::list<QPDFObjectHandle> object_queue; std::vector<QPDFObjectHandle> object_queue;
size_t object_queue_front{0};
std::map<QPDFObjGen, int> obj_renumber; std::map<QPDFObjGen, int> obj_renumber;
std::map<int, QPDFXRefEntry> xref; std::map<int, QPDFXRefEntry> xref;
std::map<int, qpdf_offset_t> lengths; std::map<int, qpdf_offset_t> lengths;

View File

@ -3363,9 +3363,9 @@ QPDFWriter::writeStandard()
} }
// Now start walking queue, outputting each object. // Now start walking queue, outputting each object.
while (this->m->object_queue.size()) { while (m->object_queue_front < m->object_queue.size()) {
QPDFObjectHandle cur_object = this->m->object_queue.front(); QPDFObjectHandle cur_object = m->object_queue.at(m->object_queue_front);
this->m->object_queue.pop_front(); ++m->object_queue_front;
writeObject(cur_object); writeObject(cur_object);
} }