shell/math: code shrink

function                                             old     new   delta
evaluate_string                                     1432    1414     -18

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
master
Denys Vlasenko 2023-06-17 00:28:49 +02:00
parent 550696d492
commit d6f98f214b
1 changed files with 3 additions and 3 deletions

View File

@ -889,9 +889,9 @@ dbg(" numstack:%d val:%lld '%s'", (int)(numstackptr - numstack), numstackptr[
*/
if (math_state->evaluation_disabled & TOP_BIT_ULL)
goto err; /* >63 levels of ?: nesting not supported */
math_state->evaluation_disabled <<= 1;
if (numstackptr[-1].val == 0)
math_state->evaluation_disabled |= 1;
math_state->evaluation_disabled =
(math_state->evaluation_disabled << 1)
| (numstackptr[-1].val == 0);
dbg("'?' entered: evaluation_disabled=%llx", EVAL_DISABLED);
}
} /* if */