1
0
forked from aniani/vim

patch 8.2.4823: concat more than 2 strings in :def function is inefficient

Problem:    Concatenating more than 2 strings in a :def function is
            inefficient.
Solution:   Add a count to the CONCAT instruction. (closes #10276)
This commit is contained in:
LemonBoy
2022-04-25 12:43:20 +01:00
committed by Bram Moolenaar
parent af59e34f1b
commit 372bcceeee
9 changed files with 100 additions and 32 deletions

View File

@@ -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);