From c8fe3bdf72b0df1c0b68f180001f0a3dde206992 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 25 Aug 2012 18:48:46 -0700 Subject: Banish boolkeys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 6ea72b3a1, rv2hv and padhv have had the ability to return boo- leans in scalar context, instead of bucket stats, if flagged the right way. sub { %hash || ... } is optimised to take advantage of this. If the || is in unknown context at compile time, the %hash is flagged as being maybe a true boolean. When flagged that way, it returns a bool- ean if block_gimme() returns G_VOID. If rv2hv and padhv can already do this, then we don’t need the boolkeys op any more. We can just flag the rv2hv to return a boolean. In all the cases where boolkeys was used, we know at compile time that it is true boolean context, so we add a new flag for that. --- pp_proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'pp_proto.h') diff --git a/pp_proto.h b/pp_proto.h index 52011dadd3..833738d5dd 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -27,7 +27,6 @@ PERL_CALLCONV OP *Perl_pp_binmode(pTHX); PERL_CALLCONV OP *Perl_pp_bit_and(pTHX); PERL_CALLCONV OP *Perl_pp_bit_or(pTHX); PERL_CALLCONV OP *Perl_pp_bless(pTHX); -PERL_CALLCONV OP *Perl_pp_boolkeys(pTHX); PERL_CALLCONV OP *Perl_pp_break(pTHX); PERL_CALLCONV OP *Perl_pp_caller(pTHX); PERL_CALLCONV OP *Perl_pp_chdir(pTHX); -- cgit v1.2.1