From 095c23e019a72f0109fb286db0ad1408bda5283d Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sun, 2 Feb 2014 19:29:35 +0000 Subject: [PATCH] re_intuit_start(): simplify check-only origin test In the case where there's no "other" substring, we check whether the regex origin would be at the start of string.However, a few commits ago we introduced the rx_origin var, and we can use this value now simplify the test, which was effectively re-calculating rx_origin each time. --- regexec.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/regexec.c b/regexec.c index 9ea1773..9310167 100644 --- a/regexec.c +++ b/regexec.c @@ -1092,13 +1092,7 @@ Perl_re_intuit_start(pTHX_ ) ); - /* signed-corrected rx_origin > strpos */ - if (s - strpos > prog->check_offset_max - && (!utf8_target - || ((rx_origin = (char*)reghopmaybe3((U8*)s, - -prog->check_offset_max, (U8*) strpos)) - && rx_origin > strpos))) - { + if (rx_origin != strpos) { /* Fixed substring is found far enough so that the match cannot start at strpos. */ try_at_offset: -- 2.7.4