diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-04-21 11:42:43 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-04-21 11:42:43 +0000 |
commit | 4ea561bc94841f378b6950ed75b669dc60767dfa (patch) | |
tree | 7a76995aa0b9fd27756ad182df7d997dd06c953c /op.c | |
parent | 25270bc0b7409c7dbdeef1a6ec0b548e2d3e51a1 (diff) | |
download | perl-4ea561bc94841f378b6950ed75b669dc60767dfa.tar.gz |
Where possible, use SvIV instead of SvIVX, SvNV instead of SvNVX,
SvUV instead of SvUVX, and SvPV* variants instead of SvPVX*.
Document that the non-x variants are preferable whenever the expression
has no side effects. (Compilers perform common subexression
elimination). Likewise SvREFCNT_inc simple variants are valid for all
cases apart from expressions with side effects.
p4raw-id: //depot/perl@31010
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4812,7 +4812,7 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label) o = newOP(type, OPf_SPECIAL); else { o = newPVOP(type, 0, savesharedpv(label->op_type == OP_CONST - ? SvPVx_nolen_const(((SVOP*)label)->op_sv) + ? SvPV_nolen_const(((SVOP*)label)->op_sv) : "")); } #ifdef PERL_MAD @@ -5249,11 +5249,11 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) = (block || attrs || (CvFLAGS(PL_compcv) & CVf_BUILTIN_ATTRS) || PL_madskills) ? GV_ADDMULTI : GV_ADDMULTI | GV_NOINIT; - const char * const name = o ? SvPVx_nolen_const(cSVOPo->op_sv) : NULL; + const char * const name = o ? SvPV_nolen_const(cSVOPo->op_sv) : NULL; if (proto) { assert(proto->op_type == OP_CONST); - ps = SvPVx_const(((SVOP*)proto)->op_sv, ps_len); + ps = SvPV_const(((SVOP*)proto)->op_sv, ps_len); } else ps = NULL; |