1
0
forked from aniani/vim

patch 9.0.0617: calling function for reduce() has too much overhead

Problem:    Calling function for reduce() has too much overhead.
Solution:   Only call clear_tv() when needed.
This commit is contained in:
Bram Moolenaar
2022-09-28 15:19:10 +01:00
parent 371951d0c3
commit 1936c76536
3 changed files with 14 additions and 5 deletions

View File

@@ -3073,10 +3073,12 @@ list_reduce(
r = eval_expr_typval(expr, argv, 2, rettv);
clear_tv(&argv[0]);
if (argv[0].v_type != VAR_NUMBER && argv[0].v_type != VAR_UNKNOWN)
clear_tv(&argv[0]);
if (r == FAIL || called_emsg != called_emsg_start)
break;
// advance to the next item
if (range_list)
{
range_val += l->lv_u.nonmat.lv_stride;