Skip to content

Commit

Permalink
feat: optimize isEnvironmentEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
manstie committed Oct 9, 2022
1 parent 1bdd106 commit 78c071f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core-definitions/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ defineEnvironment(
);

function isEnvironmentEmpty(array: Atom[][][]) {
let atoms = 0;
for (const row of array) for (const col of row) atoms += col.length;
return atoms === 0;
for (const row of array)
for (const col of row) if (col.length > 0) return false;
return true;
}

0 comments on commit 78c071f

Please sign in to comment.