diff options
author | Austin Ziegler <austin@zieglers.ca> | 2021-12-16 10:50:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 10:50:19 -0500 |
commit | dc36fa37d11cd978ef1b1756727ad222c8d3bcb6 (patch) | |
tree | 711a8d8a3c2fc9684aff04823dfcf31b062e84cb | |
parent | d348e298072ff1a0e207822af796787ba0ada7a1 (diff) | |
parent | 2a8a8100fef8865da2b43c4d40924a08b1b67c75 (diff) | |
download | diff-lcs-dc36fa37d11cd978ef1b1756727ad222c8d3bcb6.tar.gz |
Merge pull request #71 from tiendo1011/correct-last-index-calculation
Correct last index position
-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 |