Skip to content

Commit

Permalink
Remove unnecessary typecasting
Browse files Browse the repository at this point in the history
  • Loading branch information
catloversg committed Nov 16, 2024
1 parent da87bba commit 69e0906
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/CotMG/Helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function loadStaneksGift(saveString: string): void {
}

export function zeros(width: number, height: number): number[][] {
const array: number[][] = [];
const array = [];

for (let i = 0; i < width; ++i) {
array.push(Array<number>(height).fill(0));
Expand All @@ -36,14 +36,16 @@ export function zeros(width: number, height: number): number[][] {
}

export function calculateGrid(gift: BaseGift): number[][] {
const newgrid = zeros(gift.width(), gift.height()) as unknown as number[][];
const newGrid = zeros(gift.width(), gift.height());
for (let i = 0; i < gift.width(); i++) {
for (let j = 0; j < gift.height(); j++) {
const fragment = gift.fragmentAt(i, j);
if (!fragment) continue;
newgrid[i][j] = 1;
if (!fragment) {
continue;
}
newGrid[i][j] = 1;
}
}

return newgrid;
return newGrid;
}

0 comments on commit 69e0906

Please sign in to comment.