regcomp.c: Slight refactoring for clarity
authorKarl Williamson <public@khwilliamson.com>
Wed, 30 Jan 2013 16:34:44 +0000 (09:34 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 4 Feb 2013 04:41:28 +0000 (21:41 -0700)
This code was confusing enough that until a couple of commits ago, there
was a useless setting of a local variable.

regcomp.c

index a8acde8..8e9fa31 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -9119,18 +9119,15 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
                --RExC_parse;
               parse_flags:
                parse_lparen_question_flags(pRExC_state);
-                if (UCHARAT(RExC_parse) == ':') {
-                    paren = ':';
-                }
-                nextchar(pRExC_state);
-                if (paren != ':') {
+                if (UCHARAT(RExC_parse) != ':') {
+                    nextchar(pRExC_state);
                     *flagp = TRYAGAIN;
                     return NULL;
-                } else {
-                    ret = NULL;
-                    goto parse_rest;
                 }
-                break;
+                paren = ':';
+                nextchar(pRExC_state);
+                ret = NULL;
+                goto parse_rest;
             } /* end switch */
        }
        else {                  /* (...) */