diff --git a/src/lib/getMap.ts b/src/lib/getMap.ts index 07517c4..ddfb09e 100644 --- a/src/lib/getMap.ts +++ b/src/lib/getMap.ts @@ -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; }