diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-03-17 07:22:47 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-18 06:12:29 +0800 |
commit | 59d8d50c5bbcfb9215eddc0f4314fdd1cce55422 (patch) | |
tree | b4cc7829a5e37ca72cb831598160fc8388249bb6 /runtime/lua/vim/_editor.lua | |
parent | 063b69bab4ab64b614e31ab0c93279fdbebb40b7 (diff) | |
download | rneovim-59d8d50c5bbcfb9215eddc0f4314fdd1cce55422.tar.gz rneovim-59d8d50c5bbcfb9215eddc0f4314fdd1cce55422.tar.bz2 rneovim-59d8d50c5bbcfb9215eddc0f4314fdd1cce55422.zip |
vim-patch:3495497: patch 9.1.1212: too many strlen() calls in edit.c
Problem: too many strlen() calls in edit.c
Solution: refactor edit.c and remove strlen() calls
(John Marriott)
This commit attempts to make edit.c more efficient by:
- in truncate_spaces() pass in the length of the string.
- return a string_T from get_last_insert(), so that the length of the
string is available to the caller.
- refactor stuff_insert():
- replace calls to stuffReadbuff() (which calls STRLEN() on it's
string argument) with stuffReadbuffLen() (which gets the length of
it's string argument passed in).
- replace call to vim_strrchr() which searches from the start of the
string with a loop which searches from end of the string to find the
last ESC character.
- change get_last_insert_save() to call get_last_insert() to get the
last_insert string (the logic is in one place).
closes: vim/vim#16863
https://github.com/vim/vim/commit/34954972c27244a4a1fb4eeeae2aa4e021efd100
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
0 files changed, 0 insertions, 0 deletions