Skip to content

Commit

Permalink
Merge pull request #71 from tiendo1011/correct-last-index-calculation
Browse files Browse the repository at this point in the history
Correct last index position
  • Loading branch information
halostatue committed Dec 16, 2021
2 parents d348e29 + 2a8a810 commit dc36fa3
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 dc36fa3

Please sign in to comment.