regcomp.c: Slight optimization
authorKarl Williamson <public@khwilliamson.com>
Wed, 27 Nov 2013 19:46:42 +0000 (12:46 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 3 Dec 2013 17:05:22 +0000 (10:05 -0700)
A swash is accessed either through its inversion list or its hash (only
large swashes actually have hashes; this is usually transparent).  At
this point in regcomp.c, we only will be looking at the inversion list;
by telling swash_init function that via the flag, later accesses
automatically have a level of indirection removed.

regcomp.c

index ca36cbb..baf7e32 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13019,7 +13019,12 @@ parseit:
                char *e;
 
                 /* We will handle any undefined properties ourselves */
-                U8 swash_init_flags = _CORE_SWASH_INIT_RETURN_IF_UNDEF;
+                U8 swash_init_flags = _CORE_SWASH_INIT_RETURN_IF_UNDEF
+                                       /* And we actually would prefer to get
+                                        * the straight inversion list of the
+                                        * swash, since we will be accessing it
+                                        * anyway, to save a little time */
+                                      |_CORE_SWASH_INIT_ACCEPT_INVLIST;
 
                if (RExC_parse >= RExC_end)
                    vFAIL2("Empty \\%c{}", (U8)value);