Skip to content

Commit 0081a02

Browse files
committed
Lint
1 parent 62fdcbb commit 0081a02

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

src/core/CubicOctant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class CubicOctant<T> implements Node, DataContainer<T> {
9292
for(let i = 0; i < 8; ++i) {
9393

9494
const combination = layout[i];
95-
const child = new (<typeof CubicOctant> this.constructor)();
95+
const child = new (this.constructor as typeof CubicOctant)();
9696

9797
child.min.set(
9898
(combination[0] === 0) ? min.x : mid.x,

src/core/Octant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class Octant<T> implements Node, DataContainer<T> {
6161
for(let i = 0; i < 8; ++i) {
6262

6363
const combination = layout[i];
64-
const child = new (<typeof Octant> this.constructor)();
64+
const child = new (this.constructor as typeof Octant)();
6565

6666
child.min.set(
6767
(combination[0] === 0) ? min.x : mid.x,

src/core/Octree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class Octree implements Tree, Iterable<Node> {
143143

144144
get children(): Node[] | null {
145145

146-
return this.root.children || null;
146+
return this.root.children ?? null;
147147

148148
}
149149

src/core/OctreeHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export class OctreeHelper extends Group {
115115

116116
for(let level = 0; level <= depth; ++level) {
117117

118-
const result = this.octree?.findNodesByLevel(level) || [];
118+
const result = this.octree?.findNodesByLevel(level) ?? [];
119119
this.createLineSegments(result, result.length);
120120

121121
}

src/points/PointOctant.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,7 @@ export class PointOctant<T> extends Octant<PointData<T>> {
113113

114114
if(child.contains(point, bias)) {
115115

116-
if(child.data === null) {
117-
118-
child.data = new PointData<T>();
119-
120-
}
116+
child.data ??= new PointData<T>();
121117

122118
const childData = child.data;
123119
childData.points.push(point);

0 commit comments

Comments
 (0)