summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2007-03-24 19:55:11 +0100
committerNicholas Clark <nick@ccl4.org>2007-03-25 21:59:58 +0000
commit486913e4710504fa9d2dfc83a816dec7db736060 (patch)
treea120833c8eceb73a6244dcd74e83ab9f0360b97f
parente4b7ebf3387ae98739a0f53e0f27fa7a6228338f (diff)
downloadperl-486913e4710504fa9d2dfc83a816dec7db736060.tar.gz
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
-rw-r--r--regcomp.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 919b089b45..bbff562630 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. */