[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 10:19:16 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107057

--- Comment #6 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to oliver.sander from comment #5)
> I trust your judgement on the efficiency impact.
> 
> >Ah, and by the way, it's not to make the loop "look pretty". It's to make the 
> > loop non-contiguous (like 1, 4, 5, 6, 18, 19, 20,...), which is essentially the 
> > reason why the patch fixes the bug.
> 
> I know that. :-)  But you could have written something like

Yeah, was quite sure that you knew :) And thanks for the review at all.

> for(int i=0; i<xref->getNumObjects(); i++) {
>   if (entries[i].type == xrefEntryNone)
>     continue;
> 
> which does the same, but is not as pretty.

Nope, XRef::entries is private, so no access from PDFDoc. And private is a good
thing, we shouldn't expose implementation details outside of XRef. An input
iterator could do what you suggested while maintaining proper design. But it's
not that easy to write one. If there are votes to do it, I'll try.

-- 
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/d37a9a22/attachment.html>


More information about the Poppler-bugs mailing list