summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-04-16 18:40:35 -0500
committerNicholas Clark <nick@ccl4.org>2006-04-17 11:39:27 +0000
commitd8f6592eee7fae0c2b8d86f88fb82ba0481c1967 (patch)
tree9548d46ae845a5eba41f87f1d53f80b5a8068aad /pp_ctl.c
parent9fdd7463b7e8360d31fec7e9c836e5883fb01a87 (diff)
downloadperl-d8f6592eee7fae0c2b8d86f88fb82ba0481c1967.tar.gz
pp_ctl.c caching
Message-ID: <20060417044035.GA28818@petdance.com> Date: Sun, 16 Apr 2006 23:40:35 -0500 p4raw-id: //depot/perl@27860
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f88e91dda7..acefb21a60 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -113,7 +113,7 @@ PP(pp_regcomp)
tmpstr = POPs;
if (SvROK(tmpstr)) {
- SV *sv = SvRV(tmpstr);
+ SV * const sv = SvRV(tmpstr);
if(SvMAGICAL(sv))
mg = mg_find(sv, PERL_MAGIC_qr);
}
@@ -125,14 +125,14 @@ PP(pp_regcomp)
else {
STRLEN len;
const char *t = SvPV_const(tmpstr, len);
+ regexp * const re = PM_GETRE(pm);
/* Check against the last compiled regexp. */
- if (!PM_GETRE(pm) || !PM_GETRE(pm)->precomp ||
- PM_GETRE(pm)->prelen != (I32)len ||
- memNE(PM_GETRE(pm)->precomp, t, len))
+ if (!re || !re->precomp || re->prelen != (I32)len ||
+ memNE(re->precomp, t, len))
{
- if (PM_GETRE(pm)) {
- ReREFCNT_dec(PM_GETRE(pm));
+ if (re) {
+ ReREFCNT_dec(re);
PM_SETRE(pm, NULL); /* crucial if regcomp aborts */
}
if (PL_op->op_flags & OPf_SPECIAL)