This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Optimise %hash in sub { %hash || ... }
[perl5.git] / pp_hot.c
index 2493ae5..754536a 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -873,6 +873,9 @@ PP(pp_rv2av)
            *PL_stack_sp = sv;
            return Perl_do_kv(aTHX);
        }
+       else if (PL_op->op_private & OpMAYBE_TRUEBOOL
+             && block_gimme() == G_VOID)
+           SETs(boolSV(HvUSEDKEYS(sv)));
        else if (gimme == G_SCALAR) {
            dTARGET;
            TARG = Perl_hv_scalar(aTHX_ MUTABLE_HV(sv));