vim-patch:9.1.0798: too many strlen() calls in cmdhist.c (#30895)

Problem:  too many strlen() calls in cmdhist.c
Solution: refactor code and remove strlen() calls
          (John Marriott)

closes: vim/vim#15888

8df07d0ca3

Co-authored-by: John Marriott <basilisk@internode.on.net>
This commit is contained in:
zeertzjq
2024-10-22 13:03:02 +08:00
committed by GitHub
parent 1b9dafa67b
commit ca7855c5ba
5 changed files with 25 additions and 30 deletions

View File

@@ -1789,7 +1789,7 @@ static int command_line_browse_history(CommandLineState *s)
plen = s->lookforlen;
} else {
p = get_histentry(s->histype)[s->hiscnt].hisstr;
plen = (int)strlen(p);
plen = (int)get_histentry(s->histype)[s->hiscnt].hisstrlen;
}
if (s->histype == HIST_SEARCH