Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
25 lines
632 B
Plaintext
25 lines
632 B
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
/* auxiliary function for binary search in interval table */
|
|
const bisearch = (ucs, table, tableSize) => {
|
|
let min = 0;
|
|
let mid;
|
|
let max = tableSize;
|
|
if (ucs < table[0].first || ucs > table[max].last)
|
|
return 0;
|
|
while (max >= min) {
|
|
mid = Math.floor((min + max) / 2);
|
|
if (ucs > table[mid].last) {
|
|
min = mid + 1;
|
|
}
|
|
else if (ucs < table[mid].first) {
|
|
max = mid - 1;
|
|
}
|
|
else {
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
};
|
|
exports.default = bisearch;
|