# File lib/diff/lcs/hunk.rb, line 25
25:   def initialize(data_old, data_new, piece, context, file_length_difference)
26:       # At first, a hunk will have just one Block in it
27:     @blocks = [ Diff::LCS::Block.new(piece) ]
28:     @data_old = data_old
29:     @data_new = data_new
30: 
31:     before = after = file_length_difference
32:     after += @blocks[0].diff_size
33:     @file_length_difference = after # The caller must get this manually
34: 
35:       # Save the start & end of each array. If the array doesn't exist
36:       # (e.g., we're only adding items in this block), then figure out the
37:       # line number based on the line number of the other file and the
38:       # current difference in file lengths.
39:     if @blocks[0].remove.empty?
40:       a1 = a2 = nil
41:     else
42:       a1 = @blocks[0].remove[0].position
43:       a2 = @blocks[0].remove[-1].position
44:     end
45: 
46:     if @blocks[0].insert.empty?
47:       b1 = b2 = nil
48:     else
49:       b1 = @blocks[0].insert[0].position
50:       b2 = @blocks[0].insert[-1].position
51:     end
52: 
53:     @start_old = a1 || (b1 - before)
54:     @start_new = b1 || (a1 + before)
55:     @end_old   = a2 || (b2 - after)
56:     @end_new   = b2 || (a2 + after)
57: 
58:     self.flag_context = context
59:   end