In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0479a84af089da76e98ee45ec853b871201b9fac?hp=f3227b742bc4dd157ecfe2b66fd38e4bb610a4a1>

- Log -----------------------------------------------------------------
commit 0479a84af089da76e98ee45ec853b871201b9fac
Author: Nicholas Clark <[email protected]>
Date:   Mon Jul 5 10:32:38 2010 +0100

    In pp_regcomp and pp_entereval, use newSVpvn_flags() to simplify code.
-----------------------------------------------------------------------

Summary of changes:
 pp_ctl.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index ccda760..1525789 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -216,14 +216,7 @@ PP(pp_regcomp)
            }
            else if (SvAMAGIC(tmpstr)) {
                /* make a copy to avoid extra stringifies */
-               SV* copy = newSV_type(SVt_PV);
-               sv_setpvn(copy, t, len);
-               if (SvUTF8(tmpstr))
-                   SvUTF8_on(copy);
-               else
-                   SvUTF8_off(copy);
-               sv_2mortal(copy);
-               tmpstr = copy;
+               tmpstr = newSVpvn_flags(t, len, SVs_TEMP | SvUTF8(tmpstr));
            }
 
            if (eng)
@@ -3777,10 +3770,10 @@ PP(pp_entereval)
        /* make sure we've got a plain PV (no overload etc) before testing
         * for taint. Making a copy here is probably overkill, but better
         * safe than sorry */
-       SV* tmpsv = newSV_type(SVt_PV);
-       sv_copypv(tmpsv, sv);
-       sv_2mortal(tmpsv);
-       sv = tmpsv;
+       STRLEN len;
+       const char * const p = SvPV_const(sv, len);
+
+       sv = newSVpvn_flags(p, len, SVs_TEMP | SvUTF8(sv));
     }
 
     TAINT_IF(SvTAINTED(sv));

--
Perl5 Master Repository

Reply via email to