util: Remove unused code for lower_bound.

We currently do not need support for passing first and last index to
the lower_bound function, so we just remove it.
This commit is contained in:
Priyank Patel
2021-07-02 17:50:45 +00:00
committed by Tim Abbott
parent 782fca79c4
commit cfc2d7c842
2 changed files with 3 additions and 19 deletions

View File

@@ -15,24 +15,9 @@ export function random_int(min, max) {
// for some i and false otherwise.
//
// Usage: lower_bound(array, value, [less])
// lower_bound(array, first, last, value, [less])
export function lower_bound(array, arg1, arg2, arg3, arg4) {
let first;
let last;
let value;
let less;
if (arg3 === undefined) {
first = 0;
last = array.length;
value = arg1;
less = arg2;
} else {
first = arg1;
last = arg2;
value = arg3;
less = arg4;
}
export function lower_bound(array, value, less) {
let first = 0;
const last = array.length;
if (less === undefined) {
less = function (a, b) {
return a < b;