mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
vim-patch:7.4.2019
Problem: When ignoring case utf_fold() may consume a lot of time.
Solution: Optimize for ASCII.
c4a927ca8d
This commit is contained in:
@@ -1315,6 +1315,10 @@ static int utf_convert(int a, const convertStruct *const table, size_t n_items)
|
||||
*/
|
||||
int utf_fold(int a)
|
||||
{
|
||||
if (a < 0x80) {
|
||||
// be fast for ASCII
|
||||
return a >= 0x41 && a <= 0x5a ? a + 32 : a;
|
||||
}
|
||||
return utf_convert(a, foldCase, ARRAY_SIZE(foldCase));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user