comparison src/vim9cmds.c @ 28598:d550054e1328 v8.2.4823

patch 8.2.4823: concat more than 2 strings in :def function is inefficient Commit: https://github.com/vim/vim/commit/372bcceeee8012ef3fb2f3dbc8132c3a33cb84fc Author: LemonBoy <thatlemon@gmail.com> Date: Mon Apr 25 12:43:20 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 25 Apr 2022 13:45:04 +0200
parents bd1dcc605e58
children 2da1753e6a4a
comparison
equal deleted inserted replaced
28597:aba79a888ea5 28598:d550054e1328
2123 // Gets the redirected text and put it on the stack, then store it 2123 // Gets the redirected text and put it on the stack, then store it
2124 // in the variable. 2124 // in the variable.
2125 generate_instr_type(cctx, ISN_REDIREND, &t_string); 2125 generate_instr_type(cctx, ISN_REDIREND, &t_string);
2126 2126
2127 if (lhs->lhs_append) 2127 if (lhs->lhs_append)
2128 generate_instr_drop(cctx, ISN_CONCAT, 1); 2128 generate_CONCAT(cctx, 2);
2129 2129
2130 if (lhs->lhs_has_index) 2130 if (lhs->lhs_has_index)
2131 { 2131 {
2132 // Use the info in "lhs" to store the value at the index in the 2132 // Use the info in "lhs" to store the value at the index in the
2133 // list or dict. 2133 // list or dict.