diff options
author | David Mitchell <davem@iabyn.com> | 2017-07-04 12:46:20 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-07-27 11:30:21 +0100 |
commit | a5bf735cf20c7f70ccb9686bb726d979d5043c77 (patch) | |
tree | 019d8d9a6da8a61fb453c45366ff609ea3556ba7 /pp_hot.c | |
parent | 725c44f93c35f696d7175c36a6d2ec5987b5a4d1 (diff) | |
download | perl-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)); |