regexp: Update comment in cstrchr()

This commit is contained in:
ZyX
2017-04-08 02:55:51 +03:00
parent caeff6e1af
commit acc52a953b

View File

@@ -6295,9 +6295,8 @@ static inline char_u *cstrchr(const char_u *const s, const int c)
return vim_strchr(s, c); return vim_strchr(s, c);
} }
// tolower() and toupper() can be slow, comparing twice should be a lot // Use folded case for UTF-8, slow! For ASCII use libc strpbrk which is
// faster (esp. when using MS Visual C++!). // expected to be highly optimized.
// For UTF-8 need to use folded case.
if (c > 0x80) { if (c > 0x80) {
const int folded_c = utf_fold(c); const int folded_c = utf_fold(c);
for (const char_u *p = s; *p != NUL; p += utfc_ptr2len(p)) { for (const char_u *p = s; *p != NUL; p += utfc_ptr2len(p)) {