MCPcopy Create free account
hub / github.com/nodejs/node / _find

Method _find

deps/v8/tools/system-analyzer/timeline.mjs:215–227  ·  view source on GitHub ↗
(array, compareFn, offset = 0)

Source from the content-addressed store, hash-verified

213
214 // Return the first index for which compareFn(item) is >= 0;
215 _find(array, compareFn, offset = 0) {
216 let minIndex = offset;
217 let maxIndex = array.length - 1;
218 while (minIndex < maxIndex) {
219 const midIndex = minIndex + (((maxIndex - minIndex) / 2) | 0);
220 if (compareFn(array[midIndex]) < 0) {
221 minIndex = midIndex + 1;
222 } else {
223 maxIndex = midIndex;
224 }
225 }
226 return minIndex;
227 }
228
229 getBreakdown(keyFunction, collect = false) {
230 if (keyFunction || collect) {

Callers 1

findFirstMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected