From: Stevan Little Date: Tue, 27 May 2008 20:01:00 +0000 (+0000) Subject: some speedups in Moose X-Git-Tag: 0_55~137 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0addec446871510f6deebd58a52245e33746384c;p=gitmo%2FMoose.git some speedups in Moose --- diff --git a/Changes b/Changes index 5807f58..7d61bd7 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ Revision history for Perl extension Moose +0.46 + * Moose::Meta::Class + Moose::Meta::Role + - now use the get_all_package_symbols from the + updated Class::MOP, test suite is now 10 seconds + faster + 0.45 Saturday, May 24, 2008 * Moose - Because of work in Class::MOP 0.56, all diff --git a/Makefile.PL b/Makefile.PL index 2353770..b0814d3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -12,7 +12,7 @@ my $win32 = !! ( $^O eq 'Win32' or $^O eq 'cygwin' ); # prereqs requires 'Scalar::Util' => $win32 ? '1.17' : '1.18'; requires 'Carp'; -requires 'Class::MOP' => '0.56'; +requires 'Class::MOP' => '0.57'; requires 'Sub::Exporter' => '0.972'; # only used by oose.pm, not Moose.pm :P diff --git a/README b/README index 8bbb2df..c12266a 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Moose version 0.44 +Moose version 0.46 =========================== See the individual module documentation for more information @@ -20,7 +20,6 @@ This module requires these other modules and libraries: Scalar::Util Carp Sub::Exporter - B COPYRIGHT AND LICENCE diff --git a/lib/Moose.pm b/lib/Moose.pm index c7ca1a8..6b58d69 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -4,7 +4,7 @@ package Moose; use strict; use warnings; -our $VERSION = '0.45'; +our $VERSION = '0.46'; our $AUTHORITY = 'cpan:STEVAN'; use Scalar::Util 'blessed', 'reftype'; @@ -12,7 +12,7 @@ use Carp 'confess', 'croak', 'cluck'; use Sub::Exporter; -use Class::MOP 0.56; +use Class::MOP; use Moose::Meta::Class; use Moose::Meta::TypeConstraint; diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 47a2364..7d1d9b4 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -4,12 +4,12 @@ package Moose::Meta::Class; use strict; use warnings; -use Class::MOP 0.56; +use Class::MOP; use Carp 'confess'; use Scalar::Util 'weaken', 'blessed', 'reftype'; -our $VERSION = '0.22'; +our $VERSION = '0.23'; our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::Method::Overriden; @@ -177,9 +177,10 @@ sub get_method_map { my $class_name = $self->name; my $method_metaclass = $self->method_metaclass; - foreach my $symbol ($self->list_all_package_symbols('CODE')) { + my %all_code = $self->get_all_package_symbols('CODE'); - my $code = $self->get_package_symbol('&' . $symbol); + foreach my $symbol (keys %all_code) { + my $code = $all_code{$symbol}; next if exists $map->{$symbol} && defined $map->{$symbol} && diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 6952b29..fd437ca 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -8,7 +8,7 @@ use metaclass; use Carp 'confess'; use Scalar::Util 'blessed', 'reftype'; -our $VERSION = '0.13'; +our $VERSION = '0.14'; our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::Class; @@ -290,9 +290,10 @@ sub get_method_map { my $role_name = $self->name; my $method_metaclass = $self->method_metaclass; - foreach my $symbol ($self->list_all_package_symbols('CODE')) { + my %all_code = $self->get_all_package_symbols('CODE'); - my $code = $self->get_package_symbol('&' . $symbol); + foreach my $symbol (keys %all_code) { + my $code = $all_code{$symbol}; my ($pkg, $name) = Class::MOP::get_code_info($code); diff --git a/lib/oose.pm b/lib/oose.pm index 188c659..88f6f37 100644 --- a/lib/oose.pm +++ b/lib/oose.pm @@ -3,7 +3,7 @@ package oose; use strict; use warnings; -use Class::MOP 0.56; +use Class::MOP; our $VERSION = '0.04'; our $AUTHORITY = 'cpan:STEVAN';