Skip to content

Commit

Permalink
3.04s Back at it again with a branch removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumbub committed Apr 3, 2022
1 parent b6f8ba9 commit efd5de3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/logic/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@ export const nextBoardSection = (
outSkip: Skips,
) => {
fillSkips(outSkip, i + width - 1, endI - width + 1);

do {
output[i] = isAlive(i, input, width);
if (input[i] !== output[i]) revokeSkipForNeighbours(i, outSkip, width);
i++;
} while (i % SKIP_MULTIPLYER !== 0 && i < endI);

while (i < endI) {
if (i % SKIP_MULTIPLYER === 0) while (inSkip[~~(i / SKIP_MULTIPLYER)]) i += SKIP_MULTIPLYER;
while (inSkip[~~(i / SKIP_MULTIPLYER)]) i += SKIP_MULTIPLYER;

do {
output[i] = isAlive(i, input, width);

if (input[i] !== output[i]) {
revokeSkipForNeighbours(i, outSkip, width);
}

if (input[i] !== output[i]) revokeSkipForNeighbours(i, outSkip, width);
i++;
} while (i % SKIP_MULTIPLYER !== 0 && i < endI);
}
Expand Down

0 comments on commit efd5de3

Please sign in to comment.