regcomp.c: Simplify a bit of code
authorKarl Williamson <khw@cpan.org>
Mon, 3 Dec 2018 00:39:05 +0000 (17:39 -0700)
committerKarl Williamson <khw@cpan.org>
Sat, 8 Dec 2018 04:12:16 +0000 (21:12 -0700)
By using a macro with a slightly different API, we don't have to mess
with the parse pointer.

regcomp.c

index 834af8d..350e730 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14546,9 +14546,9 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
                 *flagp |= HASWIDTH | maybe_SIMPLE;
             }
 
-           RExC_parse = p - 1;
-            Set_Node_Cur_Length(REGNODE_p(ret), parse_start);
-           RExC_parse = p;
+            Set_Node_Length(REGNODE_p(ret), p - parse_start - 1);
+            RExC_parse = p;
+
            {
                /* len is STRLEN which is unsigned, need to copy to signed */
                IV iv = len;