Optimise if (%foo) to be faster than if(keys %foo)
authordemerphq <demerphq@gmail.com>
Thu, 15 Oct 2009 13:27:30 +0000 (14:27 +0100)
committerNicholas Clark <nick@ccl4.org>
Thu, 15 Oct 2009 13:27:30 +0000 (14:27 +0100)
commit867fa1e2da145229b4db2c6e8d5b51700c15f114
tree83fd35002b63cf9db21ebf85cfa939ebaa370f1b
parent1c85afcecc8ee030e2780aa5bfa85692c8db64df
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.
14 files changed:
embed.fnc
embed.h
ext/B/t/concise-xs.t
ext/Opcode/Opcode.pm
op.c
opcode.h
opcode.pl
opnames.h
pp.c
pp.sym
pp_proto.h
proto.h
t/op/each.t
t/op/tie.t