]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.2044: Inefficient use of ga_concat() v9.1.2044
authorJohn Marriott <basilisk@internode.on.net>
Fri, 2 Jan 2026 14:11:58 +0000 (14:11 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 2 Jan 2026 14:11:58 +0000 (14:11 +0000)
commita7e671fbb9fa2af9ad6c4ba9a7a881df431cd02b
treeadfea81139fad82cc3704f9bb56b398d9de8d73e
parent96a1caac6b39b523a32d0554cb95e92dbb81e17f
patch 9.1.2044: Inefficient use of ga_concat()

Problem:  Inefficient use of ga_concat()
Solution: Use ga_concat_len() when the length is already known to avoid
          use of strlen() (John Marriott).

Additionally the following changes are done:
os_unix.c:
- in function `socket_server_list_sockets()` use a `string_T` for the
  strings `buf` and `path` for use in `ga_concat_len()`
  and drop un-needed variable `dir`.

quickfix.c:
- in function `qf_jump_print_msg()` use a `string_T` for the string
  `IObuff` for use in `ga_concat_len()`.
- in function `qf_range_text()` use a `string_T` for the string `buf`
  for use in `ga_concat_len()`.

register.c:
- simplify function `execreg_line_continuation()`.

terminal.c:
- in function `read_dump_file()` use a `string_T` for the
  string `prev_char` for use in `ga_concat_len()`.

tuple.c:
- in function `tuple_join_inner()` use a `string_T` for the
  string `s` for use in `ga_concat_len()`. Also, change local struct
  `join_T` to use `string_T`.

vim9type.c:
- in functions `type_name_tuple()` and `type_name_func()`
  use a `string_T` for the string `arg_type` for use in
  `ga_concat_len()`.

closes: #19038

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/blob.c
src/eval.c
src/evalwindow.c
src/gui.c
src/os_unix.c
src/quickfix.c
src/register.c
src/terminal.c
src/tuple.c
src/version.c
src/vim9type.c