Skip to content

Commit

Permalink
Correct last index position
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendo1011 committed Dec 14, 2021
1 parent e4b0274 commit dcdcaa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/diff/lcs/internals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def replace_next_larger(enum, value, last_index = nil)
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
Expand Down

0 comments on commit dcdcaa9

Please sign in to comment.