summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenys Vlasenko2021-07-12 13:30:30 +0200
committerDenys Vlasenko2021-07-12 13:30:30 +0200
commitab755e3717cefc06fd28ce8db56f0402412afaa3 (patch)
tree6fa25ebf806c7a70672fb7205555ca1c9a7c3175 /editors
parent8d269ef85984f6476e7fdbec2c5a70f3b5c48a72 (diff)
downloadbusybox-ab755e3717cefc06fd28ce8db56f0402412afaa3.zip
busybox-ab755e3717cefc06fd28ce8db56f0402412afaa3.tar.gz
awk: in parsing, remove superfluous NEWLINE check; optimize builtin arg evaluation
function old new delta exec_builtin 1149 1145 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 437d87e..7a28235 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -1589,8 +1589,8 @@ static void chain_group(void)
chain_until_rbrace();
return;
}
- if (tc & (TS_OPSEQ | TC_SEMICOL | TC_NEWLINE)) {
- debug_printf_parse("%s: TS_OPSEQ | TC_SEMICOL | TC_NEWLINE\n", __func__);
+ if (tc & (TS_OPSEQ | TC_SEMICOL)) {
+ debug_printf_parse("%s: TS_OPSEQ | TC_SEMICOL\n", __func__);
rollback_token();
chain_expr(OC_EXEC | Vx);
return;
@@ -2582,10 +2582,11 @@ static NOINLINE var *exec_builtin(node *op, var *res)
av[2] = av[3] = NULL;
for (i = 0; i < 4 && op; i++) {
an[i] = nextarg(&op);
- if (isr & 0x09000000)
+ if (isr & 0x09000000) {
av[i] = evaluate(an[i], TMPVAR(i));
- if (isr & 0x08000000)
- as[i] = getvar_s(av[i]);
+ if (isr & 0x08000000)
+ as[i] = getvar_s(av[i]);
+ }
isr >>= 1;
}