Fix corner case after #3460. Closes #3461

This commit is contained in:
Adomas Venčkauskas 2023-10-24 14:24:38 +03:00
parent 3b9d0ac1bb
commit 011dabd372

View file

@ -303,6 +303,7 @@ module.exports = class {
};
_binarySearchOffsets(array, searchValue, lookupByOffset=false) {
if (array.length === 0) return -1;
const idx = lookupByOffset ? 1 : 0;
const searchIdx = Math.floor(array.length / 2.0);
const inspectValue = array[searchIdx][idx];