Skip to content

Commit 7a7e792

Browse files
dmndacdlite
authored andcommitted
Make SchedulerMinHeap flow strict (facebook#16351)
@acdlite while browsing Twitter, I saw [an opportunity][1] to do something more productive than browsing Twitter. [1]: https://twitter.com/acdlite/status/1160247965908234240 Test plan: `yarn flow-ci`, `yarn test-prod`, `yarn lint`
1 parent e349da1 commit 7a7e792

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/scheduler/src/SchedulerMinHeap.js

Lines 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)