From: Vincent Pit Date: Thu, 5 Nov 2009 20:55:35 +0000 (+0100) Subject: SvREFCNT_dec already checks if the SV is non-NULL X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb39f75f02caa9f23c14dfcac8a46fb1bd154b4f;p=p5sagit%2Fp5-mst-13.2.git SvREFCNT_dec already checks if the SV is non-NULL --- diff --git a/doop.c b/doop.c index d3c49b5..3a5967d 100644 --- a/doop.c +++ b/doop.c @@ -1467,8 +1467,7 @@ Perl_do_kv(pTHX) } LvTYPE(TARG) = 'k'; if (LvTARG(TARG) != (const SV *)keys) { - if (LvTARG(TARG)) - SvREFCNT_dec(LvTARG(TARG)); + SvREFCNT_dec(LvTARG(TARG)); LvTARG(TARG) = SvREFCNT_inc_simple(keys); } PUSHs(TARG); diff --git a/pp.c b/pp.c index d0022fc..f58c0c5 100644 --- a/pp.c +++ b/pp.c @@ -349,8 +349,7 @@ PP(pp_pos) LvTYPE(TARG) = '.'; if (LvTARG(TARG) != sv) { - if (LvTARG(TARG)) - SvREFCNT_dec(LvTARG(TARG)); + SvREFCNT_dec(LvTARG(TARG)); LvTARG(TARG) = SvREFCNT_inc_simple(sv); } PUSHs(TARG); /* no SvSETMAGIC */ @@ -3226,8 +3225,7 @@ PP(pp_substr) LvTYPE(TARG) = 'x'; if (LvTARG(TARG) != sv) { - if (LvTARG(TARG)) - SvREFCNT_dec(LvTARG(TARG)); + SvREFCNT_dec(LvTARG(TARG)); LvTARG(TARG) = SvREFCNT_inc_simple(sv); } LvTARGOFF(TARG) = upos; @@ -3257,8 +3255,7 @@ PP(pp_vec) } LvTYPE(TARG) = 'v'; if (LvTARG(TARG) != src) { - if (LvTARG(TARG)) - SvREFCNT_dec(LvTARG(TARG)); + SvREFCNT_dec(LvTARG(TARG)); LvTARG(TARG) = SvREFCNT_inc_simple(src); } LvTARGOFF(TARG) = offset;