mirror of
https://github.com/neovim/neovim.git
synced 2026-09-12 09:01:02 +00:00
vim-patch:9.2.1040: matchfuzzypos() can be improved (#41786)
Problem: matchfuzzypos() can be improved
Solution: Compute the uppercase character once per character in
has_match(), instead of repeating the conversion while
scanning each candidate (Yasuhiro Matsumoto).
closes: vim/vim#21241
c0c3fbd967
Co-authored-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
This commit is contained in:
@@ -757,11 +757,12 @@ static int has_match(const char *const needle, const char *const haystack)
|
||||
|
||||
while (*n_ptr) {
|
||||
const int n_char = utf_ptr2char(n_ptr);
|
||||
const int n_upper = mb_toupper(n_char);
|
||||
bool found = false;
|
||||
|
||||
while (*h_ptr) {
|
||||
const int h_char = utf_ptr2char(h_ptr);
|
||||
if (n_char == h_char || mb_toupper(n_char) == h_char) {
|
||||
if (h_char == n_char || h_char == n_upper) {
|
||||
found = true;
|
||||
h_ptr += utfc_ptr2len(h_ptr);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user