summaryrefslogtreecommitdiff
path: root/hv.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 /hv.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 'hv.c')
-rw-r--r--hv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index b00712b77d..1c339d5c73 100644
--- a/hv.c
+++ b/hv.c
@@ -509,7 +509,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
/* This cast somewhat evil, but I'm merely using NULL/
not NULL to return the boolean exists.
And I know hv is not NULL. */
- return SvTRUE(svret) ? (void *)hv : NULL;
+ return SvTRUE_NN(svret) ? (void *)hv : NULL;
}
#ifdef ENV_IS_CASELESS
else if (mg_find((const SV *)hv, PERL_MAGIC_env)) {