summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiendo1011 <tiendo1011@gmail.com>2021-12-20 13:25:55 +0700
committertiendo1011 <tiendo1011@gmail.com>2021-12-22 13:39:20 +0700
commitfbedcd9d1afa7af9a1df55c158dd9baa731e6b20 (patch)
tree4c50983331059e78237f164078fed3b6bd8d4cf5
parent6d15558f727d8ea47db895e32ae9447685122cd2 (diff)
downloaddiff-lcs-fbedcd9d1afa7af9a1df55c158dd9baa731e6b20.tar.gz
The symmetrically makes it easier to understand
-rw-r--r--lib/diff/lcs.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb
index f102bb1..f3716e1 100644
--- a/lib/diff/lcs.rb
+++ b/lib/diff/lcs.rb
@@ -377,14 +377,14 @@ class << Diff::LCS
ai += 1
end
- next unless bj < b_size
-
- ax = string ? seq1[ai, 1] : seq1[ai]
- bx = string ? seq2[bj, 1] : seq2[bj]
- event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
- event = yield event if block_given?
- callbacks.discard_b(event)
- bj += 1
+ if bj < b_size
+ ax = string ? seq1[ai, 1] : seq1[ai]
+ bx = string ? seq2[bj, 1] : seq2[bj]
+ event = Diff::LCS::ContextChange.new('+', ai, ax, bj, bx)
+ event = yield event if block_given?
+ callbacks.discard_b(event)
+ bj += 1
+ end
end
end