diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-09-15 08:09:19 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2026-09-15 08:10:16 +0800 |
| commit | 2190e51c180a9c25030e55faca6c493fb7c9540c (patch) | |
| tree | 019d363d403aba1df84b7a19bbdd9ad5240dcef5 /runtime/lua/vim/provider/python.lua | |
| parent | 8a6c7c47b463a960542971f635afc2917c92a80c (diff) | |
| download | rneovim-2190e51c180a9c25030e55faca6c493fb7c9540c.tar.gz rneovim-2190e51c180a9c25030e55faca6c493fb7c9540c.tar.bz2 rneovim-2190e51c180a9c25030e55faca6c493fb7c9540c.zip | |
vim-patch:9.2.1101: modifier_len() scans the whole command modifier table
Problem: modifier_len() always iterates every entry of cmdmod_info_tab[]
when checking for a command modifier, even though the table is
sorted by name; this runs for every sourced line via
has_loop_cmd() and shows up when loading large syntax scripts.
Solution: Break out of the loop as soon as the table entry's first letter
is past the command's first letter, since no later entry can
match in a name-sorted table (Julien Voisin).
Adding an early break roughly halves the instruction count spent in
modifier_len() and shaves about 1.5% to 2% off single-file syntax load across
common filetypes, with no change in behaviour.
closes: vim/vim#21304
https://github.com/vim/vim/commit/4600f4afec028c049d254a89929e762f6442d549
Co-authored-by: Julien Voisin <julien.voisin@dustri.org>
Diffstat (limited to 'runtime/lua/vim/provider/python.lua')
0 files changed, 0 insertions, 0 deletions