lib/care.rb
# Hydrates a page at the certain index or returns the contents of
# that page if it is already in the cache
#
# @param io[IO] the IO to read from
# @param page_i[Integer] which page (zero-based) to hydrate and return
Hydrates a page at the certain index or returns the contents of
that page if it is already in the cache
Hydrates a page at the certain index or returns the contents of that page if it is already in the cache
def hydrate_page(io, page_i)
      return if @lowest_known_empty_page && page_i >= @lowest_known_empty_page
      @pages[page_i] ||= read_page(io, page_i)
    end
def hydrate_page ( io , page_i ) return if @lowest_known_empty_page && page_i >= @lowest_known_empty_page @pages [ page_i ] ||= read_page ( io , page_i ) end
Hydrates a page at the certain index or returns the contents of
that page if it is already in the cache
Hydrates a page at the certain index or returns the contents of that page if it is already in the cache
# Avoid trying to read the page if we know there is no content to fill it # in the underlying IO
io
the IO to read from
the IO to read from
page_i
which page (zero-based) to hydrate and return
which page ( zero - based ) to hydrate and return