summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-01-06 09:40:42 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-09 11:15:43 -0700
commit2993358115def9b909737612e6931cbb3f946710 (patch)
treeaedf2c7aac78f395a7c14962d27a4ab528963848 /regcomp.c
parenta145a4230090282c0fbecddb3fe040ceacd63849 (diff)
downloadperl-2993358115def9b909737612e6931cbb3f946710.tar.gz
regcomp.c: Add some comments
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 496b7567a4..8d324e1c42 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13394,13 +13394,18 @@ parseit:
&& classnum != _CC_BLANK
#endif
) {
+
+ /* See if it already matches the complement of this POSIX
+ * class */
if ((ANYOF_FLAGS(ret) & ANYOF_POSIXL)
&& ANYOF_POSIXL_TEST(ret, namedclass + ((namedclass % 2)
? -1
: 1)))
{
posixl_matches_all = TRUE;
- break;
+ break; /* No need to continue. Since it matches both
+ e.g., \w and \W, it matches everything, and the
+ bracketed class can be optimized into qr/./s */
}
ANYOF_POSIXL_SET(ret, namedclass);
}