summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-08 15:47:23 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:22 +0100
commitf4c975aa030b7ad74a7efda242fb8b771ea41c14 (patch)
tree44c906576016c351aed4443e10c27898833fbb68 /gv.c
parent775f2c0793edf33325b9ef09b476245658cfd66b (diff)
downloadperl-f4c975aa030b7ad74a7efda242fb8b771ea41c14.tar.gz
make callers of SvTRUE() more efficient
Where its obvious that the args can't be null, use SvTRUE_NN() instead. Avoid possible multiple evaluations of the arg by assigning to a local var first if necessary.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 9038764719..39782bcb5e 100644
--- a/gv.c
+++ b/gv.c
@@ -3184,7 +3184,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
if (off1==lt_amg) {
SV* const lessp = amagic_call(left,nullsv,
lt_amg,AMGf_noright);
- logic = SvTRUE(lessp);
+ logic = SvTRUE_NN(lessp);
} else {
SV* const lessp = amagic_call(left,nullsv,
ncmp_amg,AMGf_noright);
@@ -3557,7 +3557,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
case dec_amg:
SvSetSV(left,res); return left;
case not_amg:
- ans=!SvTRUE(res); break;
+ ans=!SvTRUE_NN(res); break;
default:
ans=0; break;
}