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 /opnames.h | |
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 'opnames.h')
-rw-r--r-- | opnames.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -380,10 +380,11 @@ typedef enum opcode { OP_LOCK = 362, OP_ONCE = 363, OP_CUSTOM = 364, + OP_BOOLKEYS = 365, OP_max } opcode; -#define MAXO 365 +#define MAXO 366 #define OP_phoney_INPUT_ONLY -1 #define OP_phoney_OUTPUT_ONLY -2 |