]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1171 v7.3.1171
authorBram Moolenaar <Bram@vim.org>
Wed, 12 Jun 2013 12:10:26 +0000 (14:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 12 Jun 2013 12:10:26 +0000 (14:10 +0200)
Problem:    Check for digits and ascii letters can be faster.
Solution:   Use a trick with one comparison. (Dominique Pelle)

src/macros.h
src/version.c

index 1737cfa54815597cf2e9029204584b5f49c55d91..2c305ce1d20d72f3cdd1342b2c3141f8f737008e 100644 (file)
 #else
 # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c))
 # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c))
-# define ASCII_ISLOWER(c) ((c) < 0x7f && islower(c))
-# define ASCII_ISUPPER(c) ((c) < 0x7f && isupper(c))
+# define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26)
+# define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26)
 #endif
 
 /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns
  * non-zero for superscript 1.  Also avoids that isdigit() crashes for numbers
- * below 0 and above 255.  For complicated arguments and in/decrement use
- * vim_isdigit() instead. */
-#define VIM_ISDIGIT(c) ((c) >= '0' && (c) <= '9')
+ * below 0 and above 255.  */
+#define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10)
 
 /* macro version of chartab().
  * Only works with values 0-255!
index e20ac7f41f7de31a22cedbd2b3f358464b1f327d..c6ef1bdd3f8db7d8a7645360463f75c3b27cc748 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1171,
 /**/
     1170,
 /**/