summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-04-21 06:41:22 -0600
committerKarl Williamson <khw@cpan.org>2020-10-12 09:45:46 -0600
commit7436a695ce7392c1cebf34ae9b05b77c9e5b86f9 (patch)
treea80a875233f0baf0884ff52766185fdfbf34231a /regcomp.c
parent1aab533b71752bd887772a5c5c5c5480e2c23387 (diff)
downloadperl-7436a695ce7392c1cebf34ae9b05b77c9e5b86f9.tar.gz
regcomp.c: Combine common code
This bit of code occurs in two places. Move it so that it gets executed before the split, so it only has to be specified once.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/regcomp.c b/regcomp.c
index a3186dd0ef..052da8853a 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -12633,12 +12633,13 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
op = *RExC_parse;
+#ifdef RE_TRACK_PATTERN_OFFSETS
+ parse_start = RExC_parse;
+#endif
+
if (op == '{') {
const char* endptr;
maxpos = NULL;
-#ifdef RE_TRACK_PATTERN_OFFSETS
- parse_start = RExC_parse; /* MJD */
-#endif
next = RExC_parse + 1;
while (isDIGIT(*next) || *next == ',') {
if (*next == ',') {
@@ -12791,9 +12792,6 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
vFAIL("Regexp *+ operand could be empty");
#endif
-#ifdef RE_TRACK_PATTERN_OFFSETS
- parse_start = RExC_parse;
-#endif
nextchar(pRExC_state);
*flagp = HASWIDTH;