mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 22:08:18 +00:00
strings: Change order of operands in condition.
utf_ptr2char only needs to be called for l > 1.
This commit is contained in:
@@ -428,7 +428,7 @@ char_u *vim_strchr(const char_u *string, int c)
|
||||
int l = (*mb_ptr2len)(p);
|
||||
|
||||
// Avoid matching an illegal byte here.
|
||||
if (utf_ptr2char(p) == c && l > 1) {
|
||||
if (l > 1 && utf_ptr2char(p) == c) {
|
||||
return (char_u *) p;
|
||||
}
|
||||
p += l;
|
||||
|
Reference in New Issue
Block a user