changeset 9477:045543df0c28 v7.4.2019

commit https://github.com/vim/vim/commit/c4a927ca8dc383190d5df2cacd3f966698b6190c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 10 18:24:27 2016 +0200 patch 7.4.2019 Problem: When ignoring case utf_fold() may consume a lot of time. Solution: Optimize for ASCII.
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jul 2016 18:30:06 +0200
parents 9c072d3b98e8
children 6b63d4ac828e
files src/mbyte.c src/version.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -3067,6 +3067,9 @@ utf_convert(
     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, (int)sizeof(foldCase));
 }
 
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2019,
+/**/
     2018,
 /**/
     2017,