simplify loop logic a bit

This commit is contained in:
filifa 2025-12-11 23:49:34 -05:00
parent d0f23af972
commit 13bec9f40b
1 changed files with 2 additions and 4 deletions

View File

@ -4,11 +4,9 @@ function isLeftAssociative(op) {
function popOps(opstack, queue, op) {
const prec = {"+": 1, "-": 1, "*": 2, "/": 2, "^": 3}
while (true) {
while (opstack.length > 0) {
const op2 = opstack.at(-1);
if (op2 === undefined) {
break;
} else if (op2 === "(") {
if (op2 === "(") {
break;
}