diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-05-21 06:22:23 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-05-22 06:37:26 +0800 |
commit | b86381f425223adf0ff91fa0746914a5774ddabb (patch) | |
tree | 3a954980956a6ac250fc2e1a875802d5057bddde /test | |
parent | 879d17ea8d62c199ea0c91c5f37a4f25495be7ce (diff) | |
download | rneovim-b86381f425223adf0ff91fa0746914a5774ddabb.tar.gz rneovim-b86381f425223adf0ff91fa0746914a5774ddabb.tar.bz2 rneovim-b86381f425223adf0ff91fa0746914a5774ddabb.zip |
vim-patch:9.1.0426: too many strlen() calls in search.c
Problem: too many strlen() calls in search.c
Solution: refactor code and remove more strlen() calls,
use explicit variable to remember strlen
(John Marriott)
closes: vim/vim#14796
https://github.com/vim/vim/commit/8c85a2a49acf80e4f53ec51e6ff2a5f3830eeddb
Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/search_spec.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/unit/search_spec.lua b/test/unit/search_spec.lua index f68cd88c12..9171cf9f06 100644 --- a/test/unit/search_spec.lua +++ b/test/unit/search_spec.lua @@ -35,9 +35,10 @@ itp('pat_has_uppercase', function() end) describe('search_regcomp', function() - local search_regcomp = function(pat, pat_save, pat_use, options) + local search_regcomp = function(pat, patlen, pat_save, pat_use, options) local regmatch = ffi.new('regmmatch_T') - local fail = search.search_regcomp(to_cstr(pat), nil, pat_save, pat_use, options, regmatch) + local fail = + search.search_regcomp(to_cstr(pat), patlen, nil, pat_save, pat_use, options, regmatch) return fail, regmatch end @@ -50,7 +51,7 @@ describe('search_regcomp', function() globals.curwin.w_onebuf_opt.wo_rl = 1 globals.curwin.w_onebuf_opt.wo_rlc = to_cstr('s') globals.cmdmod.cmod_flags = globals.CMOD_KEEPPATTERNS - local fail = search_regcomp('a\192', 0, 0, 0) + local fail = search_regcomp('a\192', 2, 0, 0, 0) eq(1, fail) eq('\192a', get_search_pat()) end) |