diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2025-07-04 12:12:41 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-04 12:12:41 +0800 |
| commit | c48dea20f5ad059d0018e9bd7e5a990029eb7043 (patch) | |
| tree | abcbb146560141df1aa4e065c07afc4cc503a3d6 /runtime/syntax/python.vim | |
| parent | 5db833b4754395b387d7e2a2475ea7645cc48b74 (diff) | |
| download | rneovim-c48dea20f5ad059d0018e9bd7e5a990029eb7043.tar.gz rneovim-c48dea20f5ad059d0018e9bd7e5a990029eb7043.tar.bz2 rneovim-c48dea20f5ad059d0018e9bd7e5a990029eb7043.zip | |
vim-patch:9.1.1508: string manipulation can be improved in cmdexpand.c (#34755)
Problem: String manipulation can be improved in cmdexpand.c
Solution: Refactor cmdexpand.c to remove calls to
STRLEN()/STRMOVE()/STRCAT() (John Marriott)
This commit does the following:
In function nextwild():
- slightly refactor the for loop to remove an array access
- call STRLEN() and store it's result for reuse
- move some variables closer to where they are used, renaming some on
the way
In function ExpandOne():
- move some calculations outside of the for loops
- factor out calls to STRCAT() (which has an inherent STRLEN() call) in
the for loop
- move some variables closer to where they are used
In function expand_files_and_dirs():
- factor out calls to STRMOVE() (which has an inherent STRLEN() call)
In function get_filetypecmd_arg():
- move declarations of the string arrays into the blocks where they are
used
In function get_breakadd_arg():
- move declaration of the string array into the block where it is
used
In function globpath():
- factor out calls to STRLEN() and STRCAT()
- move some variables closer to where they are used
And finally some minor cosmetic style changes
closes: vim/vim#17639
https://github.com/vim/vim/commit/a494ce1c64a2637719a5c1339abf19ec7c48089c
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions