On Thu, 2018-02-22 at 13:19 +0100, Francesco Pretto wrote:
> I would like to add the the lack of this method makes PoDoFo quite
> inefficient in many code paths because of the intrinsic double lookup
> of the pattern "if (haskey) then getkey".

        Hi,
I do not think the patch is needed. a) it's incomplete, you might
provide also non-const variant; b) it's safe to call already existing
GetKey(), which simply returns NULL, when the key is not found.
Supposing the keys as such cannot have NULL value makes such usage
perfectly fine.

I agree the places where "if(haskey) then getkey" pattern is used
should be changed, but the suggested method on its own doesn't help
much with it. The places should be identified and corrected, which is
to-be-done.

> Also PdfDictionary::GetKey() is surprisingly doing a double lookup
> inside (this is screaming for a optmization fix)!

Definitely, I agree. Thus I changed it in revision 1901:
http://sourceforge.net/p/podofo/code/1901

        Thanks and bye,
        zyx

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to