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 /lib | |
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 'lib')
-rw-r--r-- | lib/warnings.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm index 5777723c21..cafda2d029 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -5,7 +5,7 @@ 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. @@ -577,7 +577,7 @@ 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; |