Optimize Parser#deref! to reduce call-stack
Optimize Parser#deref! to reduce call-stack

For PDFs with a lot of resources, this makes a pretty big difference (~7
seconds for one of my test documents):

    class Receiver
      attr_accessor :page
      def invoke_xobject(label); page.xobjects[label]; end
    end
    pdf = PDF::Reader.new("pdf-with-many-images.pdf")
    pdf.pages.each { |page| page.walk Receiver.new }

    # Before: 20.070762157440186
    # After:  13.305298089981079

bernerdschaefer/pdf-reader