[git commit] shell/math: code shrink

Denys Vlasenko vda.linux at googlemail.com
Fri Jun 16 22:28:49 UTC 2023


commit: https://git.busybox.net/busybox/commit/?id=d6f98f214b3bd242f7404b68a4f9d777114fffa3
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
evaluate_string                                     1432    1414     -18

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/math.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell/math.c b/shell/math.c
index 2959e57ea..56f866bf2 100644
--- a/shell/math.c
+++ b/shell/math.c
@@ -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 */


More information about the busybox-cvs mailing list