regcomp.c: Use common code instead of duplicating it
authorKarl Williamson <khw@cpan.org>
Sat, 17 Nov 2018 22:47:02 +0000 (15:47 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 27 Nov 2018 16:54:46 +0000 (09:54 -0700)
The common code is about to get more complicated, so use it instead of a
copy.

regcomp.c

index ff26f22..04be737 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14169,14 +14169,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
 
                     /* Here, continuing a node with non-folded characters.  Add
                      * this one */
-
-                    if (UVCHR_IS_INVARIANT(ender) || ! UTF) {
-                        *(s++) = (char) ender;
-                    }
-                    else {
-                        s = (char *) uvchr_to_utf8((U8 *) s, ender);
-                        added_len = UVCHR_SKIP(ender);
-                    }
+                    goto not_fold_common;
                 }
                 else {  /* Here, does participate in some fold */