[Poppler-bugs] [Bug 107057] [Patch] Skip XRef gaps in PDFDoc save methods
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Jun 29 08:27:16 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=107057
--- Comment #3 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to oliver.sander from comment #2)
> You are copying the objectIDs into a separate std::vector just to make your
> loops look pretty. Could that have a negative impact on program run-time?
I initially felt a bit bad because of that too. But after all, the new
XRef::getObjectIds method is only called once on save, and saving is nothing
that happens at high frequency. There are just plain ints in the intermediate
vector, and the number of entries is usually small, say in the range 1..1024
(however, some extreme documents could have an extreme number of objects).
Further, 'return objectIds' is basically a non op, because of copy elision /
RVO.
The alternative to assemble an intermediate vector are
- implement input iterator on XRef
- or change the underlying containment for XRef::entries to list or map
- or something about coroutines :)
I guess it's not worth it. But it needs a bit of poppler experience to judge
about. What do you think?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180629/07f9f1c2/attachment.html>
More information about the Poppler-bugs
mailing list