This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a145a42
)
regcomp.c: Add some comments
author
Karl Williamson
<public@khwilliamson.com>
Mon, 6 Jan 2014 16:40:42 +0000
(09:40 -0700)
committer
Karl Williamson
<public@khwilliamson.com>
Thu, 9 Jan 2014 18:15:43 +0000
(11:15 -0700)
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
496b756
..
8d324e1
100644
(file)
--- 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);
}