0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.0546: Vim9: varargs implementation is inefficient

Problem:    Vim9: varargs implementation is inefficient.
Solution:   Create list without moving the arguments.
This commit is contained in:
Bram Moolenaar
2020-04-11 22:31:27 +02:00
parent d19a8f97ad
commit fe27081724
3 changed files with 52 additions and 69 deletions

View File

@@ -5584,15 +5584,6 @@ compile_def_function(ufunc_T *ufunc, int set_return_type)
ufunc->uf_def_arg_idx[count] = instr->ga_len;
}
// If varargs is use, push a list. Empty if no more arguments.
if (ufunc->uf_va_name != NULL)
{
if (generate_NEWLIST(&cctx, 0) == FAIL
|| generate_STORE(&cctx, ISN_STORE,
-STACK_FRAME_SIZE - 1, NULL) == FAIL)
goto erret;
}
/*
* Loop over all the lines of the function and generate instructions.
*/