summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-04 12:46:20 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:21 +0100
commita5bf735cf20c7f70ccb9686bb726d979d5043c77 (patch)
tree019d8d9a6da8a61fb453c45366ff609ea3556ba7 /pp_hot.c
parent725c44f93c35f696d7175c36a6d2ec5987b5a4d1 (diff)
downloadperl-a5bf735cf20c7f70ccb9686bb726d979d5043c77.tar.gz
S_check_for_bool_cxt(): special-case OP_AND
Re-instate the special-casing, which was removed by v5.25.8-172-gb243b19, of OP_AND in boolean-context determination. This is because the special-case allowed things to be more efficient sometimes, but required returning a false value as sv_2mortal(newSViv(0))) rather than &PL_sv_no. Now that PL_sv_zero has been added we can use that instead, cheaply. This commit adds an extra arg to S_check_for_bool_cxt() to indicate whether the op supports the special-casing of OP_AND.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 9ab42b7546..6bd5750ee5 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1042,7 +1042,7 @@ PP(pp_rv2av)
|| ( PL_op->op_private & OPpMAYBE_TRUEBOOL
&& block_gimme() == G_VOID ))
&& (!SvRMAGICAL(sv) || !mg_find(sv, PERL_MAGIC_tied)))
- SETs(HvUSEDKEYS(MUTABLE_HV(sv)) ? &PL_sv_yes : &PL_sv_no);
+ SETs(HvUSEDKEYS(MUTABLE_HV(sv)) ? &PL_sv_yes : &PL_sv_zero);
else if (gimme == G_SCALAR) {
dTARG;
TARG = Perl_hv_scalar(aTHX_ MUTABLE_HV(sv));