[libclass-tiny-perl] 02/05: optimization: reduce memory usage of %CLASS_ATTRIBUTES
gregor herrmann
gregoa at debian.org
Sun May 31 14:03:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to annotated tag release-0.002
in repository libclass-tiny-perl.
commit bf84de611716a485a4c9be7a54a8be8a420cfb25
Author: Olivier Mengué <dolmen at cpan.org>
Date: Mon Aug 19 11:38:04 2013 +0200
optimization: reduce memory usage of %CLASS_ATTRIBUTES
---
lib/Class/Tiny.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/Class/Tiny.pm b/lib/Class/Tiny.pm
index 45d195e..9b26f07 100644
--- a/lib/Class/Tiny.pm
+++ b/lib/Class/Tiny.pm
@@ -27,7 +27,7 @@ sub import {
defined and !ref and /^[^\W\d]\w*$/s
or Carp::croak "Invalid accessor name '$_'"
} @_;
- $CLASS_ATTRIBUTES{$pkg} = { map { $_ => 1 } @attr };
+ $CLASS_ATTRIBUTES{$pkg} = { map { $_ => undef } @attr };
my $child = !!@{"${pkg}::ISA"};
#<<< No perltidy
eval join "\n", ## no critic: intentionally eval'ing subs here
@@ -65,7 +65,7 @@ sub new {
my @search = @{ mro::get_linear_isa($class) };
for my $k ( keys %$args ) {
push @bad, $k
- unless grep { $CLASS_ATTRIBUTES{$_}{$k} } @search;
+ unless grep { exists $CLASS_ATTRIBUTES{$_}{$k} } @search;
}
if (@bad) {
Carp::croak("Invalid attributes for $class: @bad");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libclass-tiny-perl.git
More information about the Pkg-perl-cvs-commits
mailing list