summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-07-02 20:50:33 -0600
committerKarl Williamson <public@khwilliamson.com>2012-07-24 21:13:44 -0600
commit575a8a29f39b3d855395253b9ccab1549a4f1bf9 (patch)
tree59c18272c55c1a11f7f8c4093b287f4c4350daf6 /regcomp.h
parent66c6912424f787a27c1af7036d53cceb315da7c2 (diff)
downloadperl-575a8a29f39b3d855395253b9ccab1549a4f1bf9.tar.gz
regcomp.c: Use data structure properties to remove tests
The ANYOF_foo character class #defines really form an enum, with the property that the regular one is n, and its complement is n+1. So we can replace the tests in each case: of the switch, with a single test afterwards.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.h b/regcomp.h
index d5668ca883..1fb6059c47 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -385,7 +385,7 @@ struct regnode_charclass_class {
/* Character classes for node->classflags of ANYOF */
/* Should be synchronized with a table in regprop() */
-/* 2n should pair with 2n+1 */
+/* 2n should be the normal one, paired with its complement at 2n+1 */
#define ANYOF_ALNUM 0 /* \w, PL_utf8_alnum, utf8::IsWord, ALNUM */
#define ANYOF_NALNUM 1