diff options
author | tiendo1011 <tiendo1011@gmail.com> | 2021-12-14 15:56:17 +0700 |
---|---|---|
committer | tiendo1011 <tiendo1011@gmail.com> | 2021-12-16 13:00:39 +0700 |
commit | 2a8a8100fef8865da2b43c4d40924a08b1b67c75 (patch) | |
tree | 711a8d8a3c2fc9684aff04823dfcf31b062e84cb /lib/diff/lcs | |
parent | d348e298072ff1a0e207822af796787ba0ada7a1 (diff) | |
download | diff-lcs-2a8a8100fef8865da2b43c4d40924a08b1b67c75.tar.gz |
Correct last index position
Diffstat (limited to 'lib/diff/lcs')
-rw-r--r-- | lib/diff/lcs/internals.rb | 2 |
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 |