diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-02-17 09:16:01 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-02-17 09:16:01 +0100 |
commit | b9929960b4602ae88b3f04bf15fa8cd2bf8a5c05 (patch) | |
tree | 52bfc56460ae67d3e1901a90eab88c63a7a37e59 /regen | |
parent | 480c67241f1595db244990ae2327660f1eec3602 (diff) | |
download | perl-b9929960b4602ae88b3f04bf15fa8cd2bf8a5c05.tar.gz |
In warnings.pm, delete a hash slice, instead of using a loop.
Deleting a hash slice compiles 5 fewer ops, and executes 21 fewer than
looping over the keys to delete each in turn. Whilst this is arguably a
micro-optimisation, it does not increase obfuscation and is in code loaded
by nearly every Perl program, so feels worthwhile.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/warnings.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl index e0f3583cb6..93b26fe58f 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -439,7 +439,7 @@ read_only_bottom_close_and_rename($pm); __END__ package warnings; -our $VERSION = '1.16'; +our $VERSION = '1.17'; # Verify that we're called correctly so that warnings will work. # see also strict.pm. @@ -825,6 +825,6 @@ sub warnif # These are not part of any public interface, so we can delete them to save # space. -delete $warnings::{$_} foreach qw(NORMAL FATAL MESSAGE); +delete @warnings::{qw(NORMAL FATAL MESSAGE)}; 1; |