summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/diff/lcs/internals.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/diff/lcs/internals.rb b/lib/diff/lcs/internals.rb
index 60027f2..4977288 100644
--- a/lib/diff/lcs/internals.rb
+++ b/lib/diff/lcs/internals.rb
@@ -253,7 +253,7 @@ enumerable as either source or destination value."
end
# Binary search for the insertion point
- last_index ||= enum.size
+ last_index ||= enum.size - 1
first_index = 0
while first_index <= last_index
i = (first_index + last_index) >> 1