0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 9.1.0426: too many strlen() calls in search.c

Problem:  too many strlen() calls in search.c
Solution: refactor code and remove more strlen() calls,
          use explicit variable to remember strlen
          (John Marriott)

closes: #14796

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-05-20 19:18:26 +02:00
committed by Christian Brabandt
parent 69dff00dfb
commit 8c85a2a49a
16 changed files with 397 additions and 176 deletions

View File

@@ -5312,7 +5312,7 @@ gui_do_findrepl(
i = msg_scroll;
if (down)
{
(void)do_search(NULL, '/', '/', ga.ga_data, 1L, searchflags, NULL);
(void)do_search(NULL, '/', '/', ga.ga_data, STRLEN(ga.ga_data), 1L, searchflags, NULL);
}
else
{
@@ -5320,7 +5320,7 @@ gui_do_findrepl(
// direction
p = vim_strsave_escaped(ga.ga_data, (char_u *)"?");
if (p != NULL)
(void)do_search(NULL, '?', '?', p, 1L, searchflags, NULL);
(void)do_search(NULL, '?', '?', p, STRLEN(p), 1L, searchflags, NULL);
vim_free(p);
}