Pass index of element to util.lower_bound matching function

(imported from commit eb8ba76b4855355bc23d6419cbb0f3a4aad8b6de)
This commit is contained in:
Leo Franchi
2014-03-11 15:17:33 -04:00
parent f7b64827e4
commit 86d310a984

View File

@@ -155,7 +155,7 @@ exports.lower_bound = function (array, arg1, arg2, arg3, arg4) {
while (len > 0) {
step = Math.floor(len / 2);
middle = first + step;
if (less(array[middle], value)) {
if (less(array[middle], value, middle)) {
first = middle;
first++;
len = len - step - 1;