From: Marcus Holland-Moritz Date: Sat, 24 Mar 2007 18:55:11 +0000 (+0100) Subject: Re: The performance problem of 30678 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=486913e4710504fa9d2dfc83a816dec7db736060;p=p5sagit%2Fp5-mst-13.2.git Re: The performance problem of 30678 Message-ID: <20070324185511.02f84668@r2d2> Date: Sat, 24 Mar 2007 18:55:11 +0100 p4raw-id: //depot/perl@30753 --- diff --git a/regcomp.c b/regcomp.c index 919b089..bbff562 100644 --- a/regcomp.c +++ b/regcomp.c @@ -8730,10 +8730,28 @@ Perl_reg_temp_copy (pTHX_ struct regexp *r) { s->min_offset = r->substrs->data[i].min_offset; s->max_offset = r->substrs->data[i].max_offset; s->end_shift = r->substrs->data[i].end_shift; - s->substr = SvREFCNT_inc(r->substrs->data[i].substr); - s->utf8_substr = SvREFCNT_inc(r->substrs->data[i].utf8_substr); + if (i < 2) { + s->substr = SvREFCNT_inc(r->substrs->data[i].substr); + s->utf8_substr = SvREFCNT_inc(r->substrs->data[i].utf8_substr); + } } - } + if (r->check_substr == r->anchored_substr) + ret->check_substr = ret->anchored_substr; + else if (r->check_substr == r->float_substr) + ret->check_substr = ret->float_substr; + else { + assert(!r->check_substr); + ret->check_substr = NULL; + } + if (r->check_utf8 == r->anchored_utf8) + ret->check_utf8 = ret->anchored_utf8; + else if (r->check_utf8 == r->float_utf8) + ret->check_utf8 = ret->float_utf8; + else { + assert(!r->check_utf8); + ret->check_utf8 = NULL; + } + } RX_MATCH_COPIED_off(ret); #ifdef PERL_OLD_COPY_ON_WRITE /* this is broken. */