This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
doop.c: use new SvPVCLEAR and constant string friendly macros
authorYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 09:14:25 +0000 (11:14 +0200)
committerYves Orton <demerphq@gmail.com>
Wed, 19 Oct 2016 11:28:01 +0000 (13:28 +0200)
doop.c

diff --git a/doop.c b/doop.c
index 79cf4b6..5525c47 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -680,7 +680,7 @@ Perl_do_join(pTHX_ SV *sv, SV *delim, SV **mark, SV **sp)
        ++mark;
     }
 
-    sv_setpvs(sv, "");
+    SvPVCLEAR(sv);
     /* sv_setpv retains old UTF8ness [perl #24846] */
     SvUTF8_off(sv);
 
@@ -1008,7 +1008,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
     PERL_ARGS_ASSERT_DO_VOP;
 
     if (sv != left || (optype != OP_BIT_AND && !SvOK(sv)))
-        sv_setpvs(sv, "");        /* avoid undef warning on |= and ^= */
+        SvPVCLEAR(sv);        /* avoid undef warning on |= and ^= */
     if (sv == left) {
        lsave = lc = SvPV_force_nomg(left, leftlen);
     }