This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Save a test by moving a line of code
authorKarl Williamson <public@khwilliamson.com>
Mon, 7 Jan 2013 06:10:16 +0000 (23:10 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 11 Jan 2013 18:50:36 +0000 (11:50 -0700)
The condition for executing this moved code are met by the else clause a
few lines below.

regcomp.c

index 3ee8440..c699996 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11311,10 +11311,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, const bool st
     /* Assume we are going to generate an ANYOF node. */
     ret = reganode(pRExC_state, ANYOF, 0);
 
-    if (!SIZE_ONLY) {
-       ANYOF_FLAGS(ret) = 0;
-    }
-
     if (UCHARAT(RExC_parse) == '^') {  /* Complement of range. */
        RExC_parse++;
         invert = TRUE;
@@ -11326,6 +11322,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, const bool st
        listsv = &PL_sv_undef; /* For code scanners: listsv always non-NULL. */
     }
     else {
+        ANYOF_FLAGS(ret) = 0;
+
        RExC_emit += ANYOF_SKIP;
        if (LOC) {
            ANYOF_FLAGS(ret) |= ANYOF_LOCALE;