Skip to content

Commit

Permalink
2.64s Wow just creating a local reference for math.min
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumbub committed Apr 3, 2022
1 parent e37da62 commit 545195c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/logic/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const nextBoardSection = (
inSkip: Skips,
outSkip: Skips,
) => {
const min = Math.min;
fillSkips(outSkip, i + width - 1, endI - width + 1);

do {
Expand All @@ -48,7 +49,7 @@ export const nextBoardSection = (
while (i < endI) {
while (inSkip[i / SKIP_MULTIPLYER]) i += SKIP_MULTIPLYER;

const tilI = Math.min(i + SKIP_MULTIPLYER, endI);
const tilI = min(i + SKIP_MULTIPLYER, endI);
while (i < tilI) {
output[i] = isAlive(i, input, width);
if (input[i] !== output[i]) revokeSkipForNeighbours(i, outSkip, width);
Expand Down

0 comments on commit 545195c

Please sign in to comment.