GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Make SchedulerMinHeap flow strict (#16351) · react/react@7a7e792

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/scheduler/src
    • SchedulerMinHeap.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/scheduler/src/SchedulerMinHeap.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/SchedulerMinHeap.js
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @flow
7+
* @flow strict
88
*/
99

1010
type Heap = Array<Node>;
@@ -38,7 +38,8 @@ export function pop(heap: Heap): Node | null {
3838
}
3939
}
4040

41-
function siftUp(heap, node, index) {
41+
function siftUp(heap, node, i) {
42+
let index = i;
4243
while (true) {
4344
const parentIndex = Math.floor((index - 1) / 2);
4445
const parent = heap[parentIndex];
@@ -54,7 +55,8 @@ function siftUp(heap, node, index) {
5455
}
5556
}
5657

57-
function siftDown(heap, node, index) {
58+
function siftDown(heap, node, i) {
59+
let index = i;
5860
const length = heap.length;
5961
while (index < length) {
6062
const leftIndex = (index + 1) * 2 - 1;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.