summaryrefslogtreecommitdiff
path: root/src/vim9expr.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-25 12:43:20 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-25 12:43:20 +0100
commit372bcceeee8012ef3fb2f3dbc8132c3a33cb84fc (patch)
treefd5e5a86cf23a018f653097a7c7477c532316a36 /src/vim9expr.c
parentaf59e34f1bf214ec6f2d0304c1c5b11ecda25a83 (diff)
downloadvim-git-372bcceeee8012ef3fb2f3dbc8132c3a33cb84fc.tar.gz
patch 8.2.4823: concat more than 2 strings in :def function is inefficientv8.2.4823
Problem: Concatenating more than 2 strings in a :def function is inefficient. Solution: Add a count to the CONCAT instruction. (closes #10276)
Diffstat (limited to 'src/vim9expr.c')
-rw-r--r--src/vim9expr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 69f670b24..efa2ef597 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -2513,7 +2513,8 @@ compile_expr5(char_u **arg, cctx_T *cctx, ppconst_T *ppconst)
if (may_generate_2STRING(-2, FALSE, cctx) == FAIL
|| may_generate_2STRING(-1, FALSE, cctx) == FAIL)
return FAIL;
- generate_instr_drop(cctx, ISN_CONCAT, 1);
+ if (generate_CONCAT(cctx, 2) == FAIL)
+ return FAIL;
}
else
generate_two_op(cctx, op);