MCPcopy Index your code
hub / github.com/plotly/dash / siftUp

Function siftUp

dash/deps/react@18.2.0.js:2441–2458  ·  view source on GitHub ↗
(heap, node, i)

Source from the content-addressed store, hash-verified

2439 }
2440
2441 function siftUp(heap, node, i) {
2442 var index = i;
2443
2444 while (index > 0) {
2445 var parentIndex = index - 1 >>> 1;
2446 var parent = heap[parentIndex];
2447
2448 if (compare(parent, node) > 0) {
2449 // The parent is larger. Swap positions.
2450 heap[parentIndex] = node;
2451 heap[index] = parent;
2452 index = parentIndex;
2453 } else {
2454 // The parent is smaller. Exit.
2455 return;
2456 }
2457 }
2458 }
2459
2460 function siftDown(heap, node, i) {
2461 var index = i;

Callers 1

pushFunction · 0.70

Calls 1

compareFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…