From c58ebcc9f9237fee1fa85f3a069b3a7fdadccc5d Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Wed, 6 Aug 2025 14:47:32 -0400 Subject: [PATCH] -1 loop per iteration by only asserting paren () balance when () exist in the mathConf --- src/artigen/math/mathTokenizer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/artigen/math/mathTokenizer.ts b/src/artigen/math/mathTokenizer.ts index 497de35..f44c1b0 100644 --- a/src/artigen/math/mathTokenizer.ts +++ b/src/artigen/math/mathTokenizer.ts @@ -45,7 +45,7 @@ export const tokenizeMath = ( loggingEnabled && log(LT.LOG, `Split roll into mathConf ${JSON.stringify(mathConf)}`); // 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 for (let i = 0; i < mathConf.length; i++) {