summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-09-01 11:43:53 +0100
committerDavid Mitchell <davem@iabyn.com>2012-09-08 15:42:07 +0100
commit6f1854a1fe246f8633ccd4d455563cb4210ceb39 (patch)
treed8aac760ab18c3411076410bf176d0cf59b7a817 /pp_hot.c
parentfbfb1899dd79253696b441cc1c4968a1057c2574 (diff)
downloadperl-6f1854a1fe246f8633ccd4d455563cb4210ceb39.tar.gz
m// and s///; don't copy TEMP/AMAGIC strings
Currently pp_match and pp_subst make a copy of the match string if it's SvTEMP(), and in the case of pp_match, also if it's SvAMAGIC(). This is no longer necessary, as the code will always copy the string anyway if its actually needed after the match, i.e. if it detects the presence of $1, $& or //p etc. Until a few commits ago, this wasn't the case for pp_match: it would sometimes skip copying even in the presence of $1 et al for efficiency reasons. Now that that's fixed, we can remove the SvTEMP() and SvAMAGIC() tests. As to why pp_subst did the SvTEMP test, I don't know: but removing it didn't make any tests fail!
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/pp_hot.c b/pp_hot.c
index b549d1c856..0d70dfc1f5 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1321,8 +1321,6 @@ PP(pp_match)
}
if ( RX_NPARENS(rx)
|| PL_sawampersand
- || SvTEMP(TARG)
- || SvAMAGIC(TARG)
|| (RX_EXTFLAGS(rx) & (RXf_EVAL_SEEN|RXf_PMf_KEEPCOPY))
) {
r_flags |= (REXEC_COPY_STR|REXEC_COPY_SKIP_PRE);
@@ -2139,7 +2137,6 @@ PP(pp_subst)
r_flags = ( RX_NPARENS(rx)
|| PL_sawampersand
- || SvTEMP(TARG)
|| (RX_EXTFLAGS(rx) & (RXf_EVAL_SEEN|RXf_PMf_KEEPCOPY))
)
? REXEC_COPY_STR