0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.1.0870: too many strlen() calls in eval.c

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

closes: #16066

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
John Marriott
2024-11-18 20:25:21 +01:00
committed by Christian Brabandt
parent ba9e1570d2
commit bd4614f43d
5 changed files with 66 additions and 39 deletions

View File

@@ -668,12 +668,14 @@ repeat:
str = vim_strnsave(*fnamep, *fnamelen);
if (sub != NULL && str != NULL)
{
size_t slen;
*usedlen = p + 1 - src;
s = do_string_sub(str, pat, sub, NULL, flags);
s = do_string_sub(str, *fnamelen, pat, sub, NULL, flags, &slen);
if (s != NULL)
{
*fnamep = s;
*fnamelen = (int)STRLEN(s);
*fnamelen = slen;
vim_free(*bufp);
*bufp = s;
didit = TRUE;