We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a9d110 commit 6ace3a6Copy full SHA for 6ace3a6
src/layouts.ts
@@ -10,16 +10,12 @@ const _computeLeftShiftLayout = (
10
tree: Tree,
11
depth = 0,
12
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
13
- counters: { layers: number[][]; maxX: number },
+ counters: { layers: number[]; maxX: number },
14
): Readonly<TreeWithLayout> => {
15
const layers = counters.layers
16
17
- if (layers[depth] === undefined) {
18
- layers[depth] = []
19
- }
20
- const x = (layers[depth]?.at(-1) ?? -1) + 1
21
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
22
- layers[depth]!.push(x)
+ const x = (layers[depth] ?? -1) + 1
+ layers[depth] = x
23
counters.maxX = Math.max(counters.maxX, x)
24
25
return {
0 commit comments