-1 loop per iteration by only asserting paren () balance when () exist in the mathConf

This commit is contained in:
Ean Milligan 2025-08-06 14:47:32 -04:00
parent e01097b1e3
commit c58ebcc9f9
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ export const tokenizeMath = (
loggingEnabled && log(LT.LOG, `Split roll into mathConf ${JSON.stringify(mathConf)}`); loggingEnabled && log(LT.LOG, `Split roll into mathConf ${JSON.stringify(mathConf)}`);
// Verify balanced parens before doing anything // Verify balanced parens before doing anything
assertParenBalance(mathConf); if (mathConf.includes('(') || mathConf.includes(')')) assertParenBalance(mathConf);
// Evaluate all rolls into stepSolve format and all numbers into floats // Evaluate all rolls into stepSolve format and all numbers into floats
for (let i = 0; i < mathConf.length; i++) { for (let i = 0; i < mathConf.length; i++) {