diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-06 23:31:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-06 23:31:29 +0800 |
commit | 9d9af4fe2775a2f74cfc8d7963f0cc768ed08bfa (patch) | |
tree | 562d3483e56b1e87b0146925e7a34819331e1084 /src/nvim/spell.c | |
parent | c48b1421af28d0317c807bca00c7e2fff97d9ad0 (diff) | |
download | rneovim-9d9af4fe2775a2f74cfc8d7963f0cc768ed08bfa.tar.gz rneovim-9d9af4fe2775a2f74cfc8d7963f0cc768ed08bfa.tar.bz2 rneovim-9d9af4fe2775a2f74cfc8d7963f0cc768ed08bfa.zip |
vim-patch:9.0.1614: strlen() called too often for :spellrepall (#23940)
Problem: strlen() called too often for :spellrepall.
Solution: Store the result in a variable. (closes vim/vim#12497)
https://github.com/vim/vim/commit/59f7038536a370d771758dc34036cc1424be7421
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r-- | src/nvim/spell.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 9ae2036ee0..5a1b3f1965 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2606,7 +2606,7 @@ void ex_spellrepall(exarg_T *eap) } const size_t repl_from_len = strlen(repl_from); const size_t repl_to_len = strlen(repl_to); - int addlen = (int)(repl_to_len - repl_from_len); + const int addlen = (int)(repl_to_len - repl_from_len); const size_t frompatlen = repl_from_len + 7; char *frompat = xmalloc(frompatlen); |