mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-06-04 00:53:50 -04:00
-3 loops per iteration by only incrementing loop count when math is actually being handled
This commit is contained in:
@@ -98,11 +98,10 @@ export const mathSolver = (conf: MathConf[], wrapDetails = false): SolvedStep =>
|
||||
loggingEnabled && log(LT.LOG, `Evaluating roll ${JSON.stringify(conf)} | Evaluating ${JSON.stringify(curOps)}`);
|
||||
// Iterate thru all operators/operands in the conf
|
||||
for (let i = 0; i < conf.length; i++) {
|
||||
loopCountCheck('mathSolver.ts - evaluating roll');
|
||||
|
||||
loggingEnabled && log(LT.LOG, `Evaluating roll ${JSON.stringify(conf)} | Evaluating ${JSON.stringify(curOps)} | Checking ${JSON.stringify(conf[i])}`);
|
||||
// Check if the current index is in the active tier of operators
|
||||
if (curOps.includes(conf[i].toString())) {
|
||||
loopCountCheck('mathSolver.ts - evaluating roll');
|
||||
// Grab the operands from before and after the operator
|
||||
const operand1 = conf[i - 1];
|
||||
const operand2 = conf[i + 1];
|
||||
|
||||
Reference in New Issue
Block a user