[Moose-commits] r7340 - Mouse/trunk/lib/Mouse/Meta
dann at code2.0beta.co.uk
dann at code2.0beta.co.uk
Sun Jan 18 15:22:57 GMT 2009
Author: dann
Date: 2009-01-18 07:22:57 -0800 (Sun, 18 Jan 2009)
New Revision: 7340
Modified:
Mouse/trunk/lib/Mouse/Meta/Class.pm
Log:
refactored out fast method modifier as Class::Method::Modifiers::Fast and used Class::Method::Modifiers::Fast
Modified: Mouse/trunk/lib/Mouse/Meta/Class.pm
===================================================================
--- Mouse/trunk/lib/Mouse/Meta/Class.pm 2009-01-18 12:58:14 UTC (rev 7339)
+++ Mouse/trunk/lib/Mouse/Meta/Class.pm 2009-01-18 15:22:57 UTC (rev 7340)
@@ -160,38 +160,10 @@
sub attribute_metaclass { "Mouse::Meta::Class" }
-sub _install_fast_modifier {
- my $self = shift;
- my $into = shift;
- my $type = shift;
- my $modifier = pop;
-
- foreach my $name (@_) {
- my $method = Data::Util::get_code_ref( $into, $name );
-
- if ( !$method || !Data::Util::subroutine_modifier($method) ) {
-
- unless ($method) {
- $method = $into->can($name)
- or confess "The method '$name' is not found in the inheritance hierarchy for class $into";
- }
- $method = Data::Util::modify_subroutine( $method,
- $type => [$modifier] );
-
- no warnings 'redefine';
- Data::Util::install_subroutine( $into, $name => $method );
- }
- else {
- Data::Util::subroutine_modifier( $method, $type => $modifier );
- }
- }
- return;
-}
-
sub _install_modifier {
my ( $self, $into, $type, $name, $code ) = @_;
- if (eval "require Data::Util; 1") {
- $self->_install_fast_modifier(
+ if (eval "require Class::Method::Modifiers::Fast; 1") {
+ Class::Method::Modifiers::Fast::_install_modifier(
$into,
$type,
$name,
More information about the Moose-commits
mailing list