lib/gziprb/deflate.rb
def huffman_encoding_for_codes(codes)
      # Zero length codes are ignored (and replaced with a nil code), so remove them from the
      # output. N.B. we need to preserve the correct position of the non-nil elements so can't
      # remove the nil elements before the each_with_index.
      codes.each_with_index.reject { |e, _| e.nil? }.map(&:reverse).to_h
    end
# Distance codes 0-31 are represented by (fixed-length) 5-bit codes, with possible additional
# bits as shown in the table shown in Paragraph 3.2.5, above. Note that distance codes 30-31
# will never actually occur in the compressed data.
Distance codes 0-31 are represented by (fixed-length) 5-bit codes, with possible additional
bits as shown in the table shown in Paragraph 3.2.5, above. Note that distance codes 30-31
will never actually occur in the compressed data.
Distance codes 0 - 31 are represented by ( fixed - length ) 5 - bit codes with possible additional bits as shown in the table shown in Paragraph 3 . 2 . 5 above . Note that distance codes 30 - 31 will never actually occur in the compressed data .
def huffman_encoding_for_codes(codes)
      codes.each_with_index.reject { |e, _| e.nil? }.map(&:reverse).to_h
    end
def huffman_encoding_for_codes ( codes ) codes . each_with_index . reject { | e , _ | e . nil? } . map ( & :reverse ) . to_h end
Distance codes 0-31 are represented by (fixed-length) 5-bit codes, with possible additional
bits as shown in the table shown in Paragraph 3.2.5, above.
Distance codes 0 - 31 are represented by ( fixed - length ) 5 - bit codes with possible additional bits as shown in the table shown in Paragraph 3 . 2 . 5 above .
# Zero length codes are ignored (and replaced with a nil code), so remove them from the # output. N.B. we need to preserve the correct position of the non-nil elements so can't # remove the nil elements before the each_with_index.
codes