summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2014-02-17 19:07:08 +0000
committerDavid Mitchell <davem@iabyn.com>2014-03-16 18:03:49 +0000
commitf746537561e2b62be6215d1e69383606e59deef5 (patch)
treedf519a06e1d5ae006b1a5de41bcc481c76fa1fde /regexec.c
parent4f6684feb3d78081996bc01d27f11b937a9c2277 (diff)
downloadperl-f746537561e2b62be6215d1e69383606e59deef5.tar.gz
re_intuit_start(): eliminate one label
Currently the code looks like: if (rx_origin + start_shift >= check_at) goto retry_floating_check; .... retry_floating_check: rx_origin = check_at - start_shift; goto hop_and_restart; But that conditional only kicks in when the floating substring (which was the check substring) matched, so this condition always applies: rx_origin + start_shift <= check_at So the condition in the code will only ever be true when rx_origin + start_shift == check_at In this case, this assignment is a noop: rx_origin = check_at - start_shift; So skip it and jump directly to hop_and_restart. This eliminates the retry_floating_check: label.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regexec.c b/regexec.c
index 5d70686592..73bd53232d 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1296,8 +1296,10 @@ Perl_re_intuit_start(pTHX_
goto restart;
}
/* Have both, check_string is floating */
- if (rx_origin + start_shift >= check_at) /* Contradicts floating=check */
- goto retry_floating_check;
+ assert(rx_origin + start_shift <= check_at);
+ if (rx_origin + start_shift == check_at)
+ /* already at latest position float substr could match */
+ goto hop_and_restart;
/* Recheck anchored substring, but not floating... */
if (!check) {
rx_origin = NULL;
@@ -1327,7 +1329,6 @@ Perl_re_intuit_start(pTHX_
if (!(utf8_target ? prog->float_utf8 : prog->float_substr)) /* Could have been deleted */
goto fail;
/* Check is floating substring. */
- retry_floating_check:
rx_origin = check_at - start_shift;
goto hop_and_restart;
}