diff options
author | demerphq <demerphq@gmail.com> | 2009-10-15 14:27:30 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-10-15 14:27:30 +0100 |
commit | 867fa1e2da145229b4db2c6e8d5b51700c15f114 (patch) | |
tree | 83fd35002b63cf9db21ebf85cfa939ebaa370f1b /ext | |
parent | 1c85afcecc8ee030e2780aa5bfa85692c8db64df (diff) | |
download | perl-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 'ext')
-rw-r--r-- | ext/B/t/concise-xs.t | 2 | ||||
-rw-r--r-- | ext/Opcode/Opcode.pm | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index b50cbb230d..d90011394d 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -148,7 +148,7 @@ my $testpkgs = { ), $] > 5.009 ? ('unitcheck_av') : ()], }, - B::Deparse => { dflt => 'perl', # 235 functions + B::Deparse => { dflt => 'perl', # 236 functions XS => [qw( svref_2object perlstring opnumber main_start main_root main_cv )], diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index d778294718..31b6f4471c 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -6,7 +6,7 @@ use strict; our($VERSION, @ISA, @EXPORT_OK); -$VERSION = "1.13"; +$VERSION = "1.14"; use Carp; use Exporter (); @@ -311,6 +311,7 @@ invert_opset function. rv2av aassign aelem aelemfast aslice av2arylen rv2hv helem hslice each values keys exists delete aeach akeys avalues + boolkeys preinc i_preinc predec i_predec postinc i_postinc postdec i_postdec int hex oct abs pow multiply i_multiply divide i_divide |