]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1367: too many strlen() calls in gui.c v9.1.1367
authorJohn Marriott <basilisk@internode.on.net>
Wed, 7 May 2025 17:59:42 +0000 (19:59 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 7 May 2025 17:59:42 +0000 (19:59 +0200)
commitd2fcbb465d354029e9b085f7fbadc9c0a791b155
treeb332af80ed44c35640b830c91b3dfa7c4711a00c
parent38972d8b1ae2be48e63b9cbe086084a52198c9aa
patch 9.1.1367: too many strlen() calls in gui.c

Problem:  too many strlen() calls in gui.c
Solution: refactor gui.c slightly (John Marriott)

This does the following changes:
- use macro STRCMP() instead of strcmp().
- refactor gui_outstr_nowrap() to remove call to STRLEN().
- refactor get_tabline_label() in attempt to simply it. At the same time
  use standard looping construct for iterating over windows in a tab.
  Move variables closer to where they are used. Add check that we don't
  exceed size of NameBuff.
- small optimisation in get_find_dialog_text() to measure the string
  length once.

closes: #17269

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui.c
src/version.c