diff options
author | David Mitchell <davem@iabyn.com> | 2014-01-26 14:19:47 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-02-07 22:39:37 +0000 |
commit | 6480a6c448dec40aad54025b06ea6b8bdbc54527 (patch) | |
tree | 57714ab372465d985a65377bf003c9c65bf52919 /regcomp.c | |
parent | 3043e7b49611b7462047bf3742511470995b98bd (diff) | |
download | perl-6480a6c448dec40aad54025b06ea6b8bdbc54527.tar.gz |
regex substrs: record index of check substr
Currently prog->substrs->data[] is a 3 element array of structures.
Elements 0 and 1 record the longest anchored and floating substrings,
while element 2 ('check'), is a copy of the longest of 0 and 1.
Record in a new field, prog->substrs->check_ix, the index of which element
was copied. (Eventually I intend to remove the copy altogether.)
Also for the anchored substr, set max_offset equal to min offset.
Previously it was left as zero and ignored, although if copied to check,
the check copy of max *was* set equal to min. Having this always set will
allow us to make the code simpler.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6953,6 +6953,7 @@ reStudy: /* A temporary algorithm prefers floated substr to fixed one to dig * more info. */ if (longest_fixed_length > longest_float_length) { + r->substrs->check_ix = 0; r->check_end_shift = r->anchored_end_shift; r->check_substr = r->anchored_substr; r->check_utf8 = r->anchored_utf8; @@ -6961,6 +6962,7 @@ reStudy: r->intflags |= PREGf_NOSCAN; } else { + r->substrs->check_ix = 1; r->check_end_shift = r->float_end_shift; r->check_substr = r->float_substr; r->check_utf8 = r->float_utf8; @@ -6972,6 +6974,8 @@ reStudy: if (SvTAIL(r->check_substr ? r->check_substr : r->check_utf8)) r->extflags |= RXf_INTUIT_TAIL; } + r->substrs->data[0].max_offset = r->substrs->data[0].min_offset; + /* XXX Unneeded? dmq (shouldn't as this is handled elsewhere) if ( (STRLEN)minlen < longest_float_length ) minlen= longest_float_length; |