lib/gziprb/lz77/compress.rb
def next_element
      distance, length = @output_buffer.find_longest_prefix(@input_buffer, @max_prefix_length)

      if distance && length >= MINIMUM_LENGTH
        Element.length_distance(length, distance)
      else
        Element.literal(@input_buffer[0])
      end
    end
# Conceptually it takes at least 2 bytes to describe a length/distance pair; unless the length
# is >= 3, it's not worth using a length/distance pair, and the literal bytes should be
# emitted.
Conceptually it takes at least 2 bytes to describe a length/distance pair; unless the length
is >= 3, it's not worth using a length/distance pair, and the literal bytes should be
emitted.
Conceptually it takes at least 2 bytes to describe a length / distance pair ; unless the length is > = 3 it ' s not worth using a length / distance pair and the literal bytes should be emitted .
def next_element
      distance, length = @output_buffer.find_longest_prefix(@input_buffer, @max_prefix_length)
      if distance && length >= MINIMUM_LENGTH
        Element.length_distance(length, distance)
      else
        Element.literal(@input_buffer[0])
      end
    end
def next_element distance , length = @output_buffer . find_longest_prefix ( @input_buffer , @max_prefix_length ) if distance && length >= MINIMUM_LENGTH Element . length_distance ( length , distance ) else Element . literal ( @input_buffer [ 0 ] ) end end
Conceptually it takes at least 2 bytes to describe a length/distance pair; unless the length
is >= 3, it's not worth using a length/distance pair, and the literal bytes should be
emitted.
Conceptually it takes at least 2 bytes to describe a length / distance pair ; unless the length is > = 3 it ' s not worth using a length / distance pair and the literal bytes should be emitted .