Skip to content

Commit

Permalink
feat: improve perf
Browse files Browse the repository at this point in the history
  • Loading branch information
rei1024 committed Oct 22, 2024
1 parent 8312b90 commit cfe3968
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/getMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ export function getMap({
const rowIndex = i * width;
for (let j = 0; j < width; j++) {
const offset = rowIndex + j;
// skip if empty
if (orUint32Array[offset] === 0) {
continue;
}
const BITS_J = j * BITS;
for (let u = 0; u < BITS; u++) {
// skip if dead
if (getAlive(orUint32Array, offset, u) === 0) {
continue;
}
Expand Down

0 comments on commit cfe3968

Please sign in to comment.