summaryrefslogtreecommitdiff
path: root/pp_proto.h
diff options
context:
space:
mode:
authordemerphq <demerphq@gmail.com>2009-10-15 14:27:30 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-15 14:27:30 +0100
commit867fa1e2da145229b4db2c6e8d5b51700c15f114 (patch)
tree83fd35002b63cf9db21ebf85cfa939ebaa370f1b /pp_proto.h
parent1c85afcecc8ee030e2780aa5bfa85692c8db64df (diff)
downloadperl-867fa1e2da145229b4db2c6e8d5b51700c15f114.tar.gz
Optimise if (%foo) to be faster than if(keys %foo)
Thread was "[PATCH] Make if (%hash) {} act the same as if (keys %hash) {}" http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00432.html but the implementation evolved from the approach described in the subject, to instead add a new opcode pp_boolkeys, to exactly preserve the existing behaviour. Various conflicts with the passage of time resolved, 'register' removed, and a $VERSION bump.
Diffstat (limited to 'pp_proto.h')
-rw-r--r--pp_proto.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp_proto.h b/pp_proto.h
index 0c1829ad74..16c5c8c898 100644
--- a/pp_proto.h
+++ b/pp_proto.h
@@ -409,5 +409,6 @@ PERL_PPDEF(Perl_pp_getlogin)
PERL_PPDEF(Perl_pp_syscall)
PERL_PPDEF(Perl_pp_lock)
PERL_PPDEF(Perl_pp_once)
+PERL_PPDEF(Perl_pp_boolkeys)
/* ex: set ro: */