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:
rover
2017-01-01 21:14:50 +08:00
parent 61d4ca214f
commit 6705652928
2 changed files with 5 additions and 1 deletions

View File

@@ -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));
}