lib/test/unit/diff.rb in test-unit-2.4.0 vs lib/test/unit/diff.rb in test-unit-2.4.1

- old
+ new

@@ -1,9 +1,9 @@ # port of Python's difflib. # # Copyright (c) 2001-2008 Python Software Foundation; All Rights Reserved -# Copyright (c) 2008-2010 Kouhei Sutou; All Rights Reserved +# Copyright (c) 2008-2011 Kouhei Sutou; All Rights Reserved # # It is free software, and is distributed under the Ruby # license and/or the PSF license. See the COPYING file and # PSFL file. @@ -164,11 +164,11 @@ queue.push([match_from_index + size, from_end, match_to_index + size, to_end]) end end end - matches.sort_by do |(from_index, to_index, match_size)| + matches.sort_by do |(from_index, _, _)| from_index end end def compute_blocks @@ -599,10 +599,10 @@ common = [common, n_leading_characters(from_tags[0, common], " "[0])].min from_tags = from_tags[common..-1].rstrip to_tags = to_tags[common..-1].rstrip - result = tag_deleted([from_line]) + tag_deleted([from_line]) unless from_tags.empty? tag_difference(["#{"\t" * common}#{from_tags}"]) end tag_inserted([to_line]) unless to_tags.empty?