In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/18ea7bf2cf79c90c0c3162783e5a0f30fbf0c026?hp=3a3ee363aabfd679b63d9486cf6aa053f4825457>
- Log ----------------------------------------------------------------- commit 18ea7bf2cf79c90c0c3162783e5a0f30fbf0c026 Author: Steffen Mueller <smuel...@cpan.org> Date: Mon Feb 10 11:40:31 2014 +0100 pp_concat: Only call SvPV_force_nolen when needed If we just did an sv_setpvs on it, the SvPV_force_nolen should not do anything useful, so let's not. Side note: s/TARG/left/ in the enclosing block because they are the same pointer, so why use a define that needs grokking by the reader of the code if the local variable is guaranteed to be the same? ----------------------------------------------------------------------- Summary of changes: pp_hot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pp_hot.c b/pp_hot.c index beb9649..79b77ab 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -278,16 +278,18 @@ PP(pp_concat) else SvUTF8_off(TARG); } - else { /* $l .= $r */ - if (!SvOK(TARG)) { + else { /* $l .= $r and left == TARG */ + if (!SvOK(left)) { if (left == right && ckWARN(WARN_UNINITIALIZED)) /* $l .= $l */ report_uninit(right); sv_setpvs(left, ""); } - SvPV_force_nomg_nolen(left); + else { + SvPV_force_nomg_nolen(left); + } lbyte = !DO_UTF8(left); if (IN_BYTES) - SvUTF8_off(TARG); + SvUTF8_off(left); } if (!rcopied) { -- Perl5 Master Repository