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)
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 69f670b..efa2ef5 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -2513,7 +2513,8 @@
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);