vim-patch:9.1.0870: too many strlen() calls in eval.c (#31267)

Problem:  too many strlen() calls in eval.c
Solution: Refactor eval.c to remove calls to STRLEN()
          (John Marriott)

closes: vim/vim#16066

bd4614f43d

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2024-11-19 19:03:29 +08:00
committed by GitHub
parent c12be1249f
commit 0183c32474
2 changed files with 33 additions and 21 deletions

View File

@@ -7848,8 +7848,8 @@ static void f_substitute(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|| flg == NULL) {
rettv->vval.v_string = NULL;
} else {
rettv->vval.v_string = do_string_sub((char *)str, (char *)pat,
(char *)sub, expr, (char *)flg);
rettv->vval.v_string = do_string_sub((char *)str, strlen(str), (char *)pat,
(char *)sub, expr, (char *)flg, NULL);
}
}