class Test::Unit::Diff::SequenceMatcher

def compute_blocks

def compute_blocks
  blocks = []
  current_from_index = current_to_index = current_size = 0
  matches.each do |from_index, to_index, size|
    if current_from_index + current_size == from_index and
        current_to_index + current_size == to_index
      current_size += size
    else
      unless current_size.zero?
        blocks << [current_from_index, current_to_index, current_size]
      end
      current_from_index = from_index
      current_to_index = to_index
      current_size = size
    end
  end
  unless current_size.zero?
    blocks << [current_from_index, current_to_index, current_size]
  end
  blocks << [@from.size, @to.size, 0]
  blocks
end